Automate data entry (web page with pop up buttons) in Applescript
Hi guys
Leopard 10.5.8, intel
My code is copying one Excel cell at a time and storing as a variable (always called typistSomething). Then it flips to a Safari window and enters all the variables quickly, one after the other. All is well, I am just having problems with changing pop up buttons! I've paired down my code to try to work on the problem area. In the following example, you have to imagine that I've just copied a media type (say, "Movie") to the clipboard, then the pop up button I get to needs to be changed to "Movie" from its default blank state. I don't think I can 'set' a pop up button like I'm trying to. Here goes:
set typistType to «class ktxt» of ((the clipboard as text) as record)
--enter type to Entry Form
activate application "Safari"
tell application "System Events"
tell process "Safari"
set pop up button "Please select the type of video file" of group 6 of UI element 1 of scroll area 1 of group 1 of UI element 1 of scroll area 1 of group 1 of window "Video Metadata" to keystroke typistType
end tell
end tell
You see, I might be getting mixed up with 'keystroke' instruction, and just 'setting' it. I have highlighted the name of the field in dark red just to separate it from my bad bits. I'm afraid I'm a real beginner with this. What do you think? I've looked at the pop up button in UI Browser, and if I hover over the selection I want then it tells me, amongst other things, menu item "Movie" (menu item 5).
Thank you
David
MacBook Pro, Mac OS X (10.5.8), Applescript, pop up button