gui scripting - pop up menu (newbie question)

hi there,

i’m new to applescripting and am trying to automate a cd writing program with a robotic duplicator. the program is not applescriptable so i’m trying to use UI scripting for this process. i’ve noticed that some buttons don’t respond to my commands. i’ve found a way around some but an stumped on a particular pop up menu.

i’m using the UI element inspector and am not quite sure what to make of this. when i click the pop up menu and scroll to the option i want (“Build A Mac HFS”), i get the following:

<AXApplication: “Discribe OSX”>
<AXWindow: “Discribe”>

<AXMenuItem: “Build A Mac HFS”>

AXRole: “AXMenuItem”
AXRoleDescription: “menu item”
AXChildren: “(null)”
AXParent: “”
AXTitle: “Build A Mac HFS”
AXEnabled: “1”
AXPosition: “x=333 y=194”
AXSize: “w=250 h=21”
AXSelectedChildren: “”
AXVisibleChildren: “”
AXHelp: “(null)”
AXMenuItemCmdChar: “
AXMenuItemCmdVirtualKey: “(null)”
AXMenuItemCmdGlyph: “(null)”
AXMenuItemCmdModifiers: “0”
AXMenuItemMarkChar: “”

AXCancel - cancels menu tracking
AXPick - selects a menu item
AXPress - selects a menu item

my question is what kind of command could i use to automatically select “Build A Mac HFS” from this pop up menu. i’ve tried a variety of things like:

tell pop up button “AXPopUpButton” of window “Discribe”
select menu item “Build A Mac HFS”
end tell

tell pop up button “AXPopUpButton” of window “Discribe”
select menu item “Build A Mac HFS”
end tell

but i just get errors. any advice would be greatly appreciated. also, if anyone knows of some good books or websites devoted specifically to UI scripting, please post them here.

matt chan

Use the title of each level instead of the kind. As an example,

select menu item “Build a Mac HFS” of popup button “PupupName” of window “Discribe”

hmm, tried that but it didnt’ work. i get an error 4. it doesn’t seem to be referencing the pop up button at all. any other suggestions?

tried using quickeys x2 to access the same popup menu but am having similar problems, presumably because it’s using the same accessibility framework?

I don’t have discribe. There are two options

  • play with the Apple Provided browser until you can make it work
  • use the PreFab UI Browser ($40) to auto-generate code for you.

i’m fiddling around with prefab right now. still having problems.

thanks for your help though. :slight_smile: