Hi
I have just created my first Applescript Studio app - a progress bar. I have only been scripting for a week so please bear with me.
My question concerns how to control buttons and other objects inside the GUI of the main window of the app.
I know I can update text fields with a statement along the lines of:
tell window 1 of application "My Progress Bar" to tell text field "Bottom Message" to set content to "Hello"
I know I can enable or disable a button with a statement along the lines of:
tell window 1 of application "My Progress Bar" to set enabled of button "Cancel Button" to true
But I would like to change the content of the button so that, for example, the “Cancel” button toggles to “Continue” and vice versa when clicked. I have tried the following:
tell window 1 of application "My Progress Bar" to set content of button "Cancel Button" to "Continue"
This seems to execute without an error but the button does not change in appearance.
Another way I thought of doing this was to have two buttons superimposed and hide and unhide as necessary using something like the following:
tell window 1 of application "My Progress Bar" to set hidden of button "Cancel Button" to true
This was coded along the same lines as the “enable” script above which works. However, the “hidden” script just throws an error saying it cannot transform “hidden” into a reference type.
Any suggestions gratefully received. General pointers to information on how to address objects (buttons, bars, sliders) and the limitations of each type of object, would also be most welcome.
Model: iBook
AppleScript: Latest
Browser: Safari 417.8
Operating System: Mac OS X (10.4)