Patrick Winkler Posted May 19, 2016 Share Posted May 19, 2016 Hello, I'm working on a script which changes the units off all VWX files in a folder. The Problem is that the file opens to late when the script is already finished. I also tried it with the sleep () command. Is there a way to open a file and make it active within a function? def main (): # Get File succes, path = vs.GetFileN('', None, None) # Open File if get_OS_Code() == OS_WIN: # Windows command os.system('start' + path ) else: # Mac command os.system('open ' + path ) # Set Units Millimeters = 7 Centimeters = 8 Meters = 9 Kilometers = 10 vs.Units (Centimeters) # Save the File vs.DoMenuTextByName("Save", 0) # Close the File vs.DoMenuTextByName("Close", 0) Quote Link to comment
JBenghiat Posted May 19, 2016 Share Posted May 19, 2016 If you're on the Mac, use AppleScript to handle opening and saving. VW provides an apple script command to run a python script. -Josh Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.