I have a “Logins” folder in Safari’s bookmark bar that contains several items. I want to select an item from this list by using a keyboard shortcut rather than the mouse. I will use a different shortcut for each item in the list. The script below (for item 2 in the list) works, but there is a very long delay between the click and the keystroke commands (on my machine 5 - 10 seconds).
I would appreciate it if someone could tell me why the long delay and whether there is a faster way?
tell application "Safari"
activate
tell application "System Events"
tell process "Safari"
tell window 1
tell group 1
tell menu button "Logins"
click
-- long delay here
keystroke (ASCII character 31)
keystroke (ASCII character 31)
keystroke (ASCII character 13)
end tell
end tell
end tell
end tell
end tell
end tell
Carl
Model: iMac 2011
AppleScript: 2.1.2
Browser: Safari 533.21.1
Operating System: Mac OS X (10.6)