1 Reply Latest reply: Apr 16, 2013 3:15 PM by red_menace
Apple_For_The_Win Level 1 (0 points)

I took my script from the original Applescript Editor and pasted it into Xcode, changing all the terms incompatible with Cocoa. At first I pasted it in between the already there code in the "Applescript.deligate" file. I built it, launched it, but... It did nothing. Then I tried deleting all the code in it and pasting only my own, again nothing. Is there a "Do Script" command or something? How do I get the application to do the script? (Mostly UI scripting)

  • red_menace Level 6 (15,125 points)

    AppleScript in Xcode is a little bit different in that there isn't an implied run handler, so your code needs to be in a handler and won't get run unless you explicitly call it.  One way to start your script would be by calling it from one of the delegate handler/methods such as applicationDidFinishLaunching, or by using an action handler/method connected to a button or other object in your application's user interface.