Myke Posted March 7, 2022 Share Posted March 7, 2022 (edited) Hello, I was wondering if there was a good way to trigger a Python script in VW using AppleScript? There are some scripts that can be "installed"? if im not mistaken. Is it possible to have VW run that command when the AppleScript ask it too? I got a bit interested in this kind of workflow when Pat Standford mentioned it. If the answer is yes, then my follow up question would be: do I need to use an installation script ie. install.py to add the functionality? Thanks Edited March 8, 2022 by Myke Quote Link to comment
Myke Posted March 14, 2022 Author Share Posted March 14, 2022 For anyone who is interested in similar functionality I have a base template as a starting point on run {input, parameters} repeat tell application "System Events" tell process "Vectorworks 2022" name of every menu of menu bar 1 click menu item "menuItem" of menu "menuBarItem" of menu bar 1 end tell end tell end repeat return input end run Cheers! 1 Quote Link to comment
michaelk Posted March 14, 2022 Share Posted March 14, 2022 Nice work! Are you using this to run menu commands in Vectorworks from apple script? Reminds me of this gem from 7 years ago 🙄 The über clever @James Russell figured out how to animate a car on a turntable with a script and so we figured out how to run a vector script inside an apple script to animate a door opening. I keep meaning to try this from my stream deck to see if I can run scripts and skip going to the workspace editor and making them into menu commands. Quote Link to comment
Myke Posted March 14, 2022 Author Share Posted March 14, 2022 Yes! This does run menu commands, apple script is surprisingly competent. I will need to make something similar in Windows, probably using PowerShell or similar. I'll add a similar template when that's good and ready. And for anyone who tries this out, I would first recommend removing the repeat syntax. The idea of this script is to have some automation of VW commands outside of the program, but it needs to constantly be checking if the app is open. @michaelk That was the same post that pushed me to automating my python scripts 1 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.