Button activated applescript?
In xcode 4.x I want to be able to click a button and have an applescript run, how do I do this?
MacBook Pro, OS X Mountain Lion (10.8.2), 2.3 GHz i5, 4GB RAM, OCZ 120GB SSD
The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.
You can continue to find trusted guidance and support on the official Apple Support site.
We want to thank the community members who have contributed their time and expertise to help others with their Apple products.
The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.
You can continue to find trusted guidance and support on the official Apple Support site.
We want to thank the community members who have contributed their time and expertise to help others with their Apple products.
In xcode 4.x I want to be able to click a button and have an applescript run, how do I do this?
MacBook Pro, OS X Mountain Lion (10.8.2), 2.3 GHz i5, 4GB RAM, OCZ 120GB SSD
Is this an AppleScriptObjC or Objective-C project? If the former, you can use regular AppleScript statements and/or call handlers in other script files, if the latter you can use the NSAppleScript class or add an AppleScriptObjC class.
If you are talking about connecting a button to your code, create an action handler/method (if it has the correct signature it will appear inn the Interface Editor), and connect it to the button, for example:
I'm new to this, where did the myButtonHandler come from?
Actually, I figured it out on my own, you were very helpful though.
Button activated applescript?