• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
uh, that's so cool! AS 1.9.1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

uh, that's so cool! AS 1.9.1


  • Subject: uh, that's so cool! AS 1.9.1
  • From: Paul Skinner <email@hidden>
  • Date: Fri, 20 Dec 2002 12:46:24 -0500

http://www.apple.com/applescript/GUI/


Scripters have often requested the ability to control, via AppleScript, applications which either do not have AppleScript support or are only partially scriptable. The new Developer Tools release contains a beta version of the System Events application incorporating support for scripting the GUI (Graphic User Interface) of applications.

Using this version of the System Events application, AppleScript scripts can select menu items, push buttons, enter text into text fields, and generally control the GUI of most non-Classic applications.

This software, which requires Mac OS X 10.2.3, is offered for testing and feedback and should not be used in mission critical environments. Please post your comments in these venues:

* Apple AppleScript Users List
* Apple Discussion Boards

The following script examples demonstrate a few possible uses of GUI scripting:
Selecting a Menu Item
(* EXECUTE MENU ITEM *)
-- replace with the target application name, the menu name, and the menu item name

if my do_menu("Finder", "Finder", "Hide Others") is false then error number -128
if my do_menu("Finder", "View", "Clean Up") is false then error number -128

on do_menu(app_name, menu_name, menu_item)
try
-- bring the target application to the front
tell application app_name
activate
end tell
tell application "System Events"
with timeout of 300 seconds -- 5 minutes
tell process app_name
tell menu bar 1
click menu item menu_item of menu menu_name
end tell
end tell
end timeout
end tell
return true
on error error_message
return false
end try
end do_menu


...
--
Paul Skinner
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: uh, that's so cool! AS 1.9.1
      • From: Dave Balderstone <email@hidden>
    • Re: uh, that's so cool! AS 1.9.1
      • From: Paul Berkowitz <email@hidden>
    • Re: uh, that's so cool! AS 1.9.1
      • From: Jaime Magiera <email@hidden>
  • Prev by Date: Re: Mac OS X v. 10.2.3 update
  • Next by Date: Re: Need help with script
  • Previous by thread: Re: File Info - Movie Preview Question from Paul Skinner
  • Next by thread: Re: uh, that's so cool! AS 1.9.1
  • Index(es):
    • Date
    • Thread