Jump to content

Is it possible to use AppleScript together with VectorWorks 9.0.1?


Recommended Posts

Hello Everyone,

I have a question and I will appreciate your help very much.

Is it possible to automate some tasks in VectorWorks with AppleScript? The tasks are in the following sequence :

1. Open VectorWorks 7 document on CD with VectorWorks 82. Push "OK" button to close conversion warning dialog.3. Save document in VectorWorks 8 format with "Save As..." specifying automaticly the path and the name.4. Open this document again in VectorWorks 9.5. Push "OK" button to close conversion warning dialog.6. Save document again in VectorWorks 9 format specifying automaticly the path and name.7. Repeat at step 1 to convert the other documents.

Can you tell me if it is possible? I think if VectorWorks is AppleScript "Recordable" it is possible, but I am not sure. On this moment I am learning AppleScript because I still have to translate between 1000 and 2000 VW7 documents and I like to accomplish this automaticly.

When we find a solution, I like to share this AppleScript with other people freely.

I realise that I ask regularly for help and therefore I appreciate your efforts to help myself and other people very much.

I thank you very much in advance and I wish you a very nice day.

Friendly greetings,

Chrissy smile.gif" border="0

Link to comment

Chrissy,

VectorWorks has 2 applescript commands"Do Script" , for running a vectorscript and "translate" . Translate is suppose to open an older document and translate it to the new version and save it under a new name. Nowwhether it will convert a MC7 document I'm not sure.

There's an applescript that converts MC6 files to MC7 here.http://www.nemetschek.net/downloads/MC7/mcupdates.htmlYou could probably update that script for your needs if your lucky.

Dave

Link to comment

Hello Dave,

Thank you for your help and your advice. I did not know that VectorScript supported AppleScript. I did a couple tests to open a document (record the actions with ScriptEditor) but they failed.

I will take a look on the script who convert V6 to V7 files. If I can adapt it to translate V7 to V9 files, I will put the code here on the message board.

Thank you very much for your advice. It is not the first time you helped me and I am very gratefull for that. If I ever can help you or do something in return, let me know.

I wish you a very nice day and all the best!

With friendly greetings,

ChrissyDesselBelgium

Link to comment

Hello,

As promised I did the translation of the VW 7 to VW 9 files. I succeeded almost completely except for one thing.

First you are asked to select a folder where the VW 7 files are located. After that the AppleScript create a folder OriginalsV7. Then the VW 7 files are converted from VW 7 to VW 8 and the originals are moved inside the Originals V7 folder. When the VW7 to VW8 translation is completed, another folder is created named Originals V8. Then the translation process start over again but this time from VW8 to VW9.

When the AppleScript ends everything seems normal. The original VW8 files are moved inside the Original V8 folder. Also the files left have Type MC9d and Creator CDP3 I checked that with ResEdit. Now comes the problem. When you try to open the documents in VW9 you get an error telling you that the document is damaged or very old.

I will copy the AppleScript here below the text. Do you know what is the cause of the error of what is wrong?

To try out the AppleScript you need VW8 and VW9 both installed on your computer. Also you need AppleScript to run or edit the Script.

In case you do not know how use AppleScript. Double click on the AppleSCript symbol on your computer. In the file menu choose New Script. A new script window will open. Paste the scriptcode below in the bottom textfield and in the top textfield write a description. Now click on run and your script will running.

I will appreciate your help very much and maybe someone from Nemetschek can put us on the right way.

Thank you very much for your help and I wish you a nice day.

With friendly greetings,

ChrissyDesselBelgiumEurope

tell application "Finder" set sampleFolder to folder ((choose folder with prompt "Select folder of MiniCAD files:") as string) set translateTargetV7 to ((sampleFolder as string) & "OriginalsV7") make new folder at sampleFolder with properties {name:"OriginalsV7"} set MCFileListV7 to every file of entire contents of sampleFolder ? whose ((creator type is "CDP3") and (file type obsolete is "MC+4"))end tell

tell application "VectorWorks 8.5.2 NL" activate repeat with fileAlias in MCFileListV7 with timeout of 1200 seconds translate fileAlias as alias tell application "Finder" move fileAlias to (translateTargetV7 as alias) end tell end timeout end repeatend tell

tell application "Finder" set translateTargetV9 to ((sampleFolder as string) & "OriginalsV8") -- display dialog ? -- translateTarget buttons {"OK"} default button 1 make new folder at sampleFolder with properties {name:"OriginalsV8"} set MCFileListV8 to every file of entire contents of sampleFolder ? whose ((creator type is "CDP3") and (file type obsolete is "MC8d"))end tell

tell application "VectorWorks 9.0.1 NL" activate repeat with fileAlias in MCFileListV8 with timeout of 1200 seconds translate fileAlias as alias tell application "Finder" move fileAlias to (translateTargetV9 as alias) end tell end timeout end repeatend tell

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...