AppleScript using end key and up arrow

1.8k views Asked by At

I am attempting to create a apple script that copies and pastes data from a application called Panorama to Excel 2011 for Mac. I have everything working almost the way I want it except when it comes to having excel move to the adjacent column and move to the 1st record position (the keyboard shortcut is the "end" key and the up arrow. I am not sure how to get applescript to recognize the the end key in combination with the up arrow. If anyone could tell me how to do that or another way of doing this it would be greatly appreciated.

Here is my code so far:

repeat 2 times

repeat 2 times

    tell application "Panorama" to activate
    tell application "System Events"
        tell process "Panorama"
            keystroke "c" using command down
            tell application "System Events" to keystroke (ASCII character 31)
        end tell
    end tell

    delay 0.8

    tell application "Microsoft Excel" to activate
    tell application "System Events"
        tell process "Microsoft Excel"
            keystroke "v" using command down
            tell application "System Events" to keystroke (ASCII character 31)
        end tell
    end tell

    delay 0.8

end repeat

tell application "Panorama" to activate
tell application "System Events"
    tell process "Panorama"
        tell application "System Events" to keystroke (ASCII character 29)
        tell application "System Events" to key code 115

    end tell
end tell

delay 0.8

tell application "Microsoft Excel" to activate
tell application "System Events"
    tell process "Microsoft Excel"
        tell application "System Events" to keystroke (ASCII character 29)
        tell application "System Events" to keystroke End using up arrow <----(This is the part not working.)
    end tell
end tell

delay 0.8

end repeat

1

There are 1 answers

3
jweaks On BEST ANSWER
tell application "System Events" to key code 119 -- End key
tell application "System Events" to key code 124 -- right arrow

See this reference page of key codes