0

i am building a simple(ish) applescript app using xCode and not the applescript app.

I have set up several buttons via the GUI and have linked them to the retrospective code via the drag and drop method in xcode

    on ThisIsMyButton_()

      ....

   end ThisIsMyButton_

But i am having trouble disabling them via code.

I have tried the following but get error

   set enabled of button "ThisIsMyButton_" to false

But as the name of the button is not set on the GUI i think its finding it hard to locate the button in question.

Any ideas much appreciated,

Using xCode 6.0.1 on an iMac

Simon Davies
  • 3,668
  • 9
  • 41
  • 69
  • Did you create an outlet pointing to the button? You need it to talk back from your script to the UI. – ShooTerKo Oct 30 '14 at 12:39
  • To create an outlet, add a line like `property myButton : missing value` to your AppDelegate.applescript, save it. After that switch to the interface builder view and ctrl-drag from the App Delegate object to your button and connect it to the outlet. – ShooTerKo Oct 30 '14 at 12:48
  • Detailed instructions for buttons in ASOC can be found at http://asobjcresources.weebly.com/connecting-buttons-to-applescript.html – Ron Reuter Apr 05 '16 at 02:54

0 Answers0