Need help with writing a simple key presser script
Hello applescript wizards,
I want to write a script that does this:
press CMD+L,
press /top?sort=top&t=week,
press enter.
My problems:
- I know how to make it type individual keystrokes, but have no idea how to make it hold a button (which is necessary to press CMD+L)
- Do I have to do
keystroke "A"
keystroke "B"
keystroke "C"
i.e. one by one, or is there a more efficient version?
Here's how it looks like so far:
on run {input, parameters}
tell application "Google Chrome" to activate
tell application "System Events" keystroke ?command? keystroke "L" keystroke "/" keystroke "t" keystroke "o" -and so on, until the end of that text keystroke ?enter?
end tell
return input end run
Big thanks in advance! Your help will be greatly appreciated.