Using an Apple Script to copy & paste between programs (on a MacBook Pro)



In this clip, we’re showing you how to use Automator and an Apple Script to perform a very basic copy & paste routine that involves more than 1 program.

Feel free to change it and use it for your own purposes. If you have any questions and need some assistance, just hit us up at [email protected] and we’ll make sure to get back to you.

Source Code:
repeat 25 times

tell application “Firefox” to activate
tell application “System Events”
tell process “Firefox”
keystroke “c” using command down
keystroke tab
end tell
end tell

delay 0.3

tell application “Microsoft Excel” to activate
tell application “System Events”
tell process “Microsoft Excel”
keystroke “v” using command down
keystroke tab
end tell
end tell

delay 0.3

tell application “Firefox” to activate
tell application “System Events”
tell process “Firefox”
keystroke “c” using command down
end tell
end tell

delay 0.3

tell application “Microsoft Excel” to activate
tell application “System Events”
tell process “Microsoft Excel”
keystroke “v” using command down
delay 0.3
keystroke tab
delay 0.4
keystroke “c” using command down
end tell
end tell

delay 0.3

tell application “Firefox” to activate
tell application “System Events”
tell process “Firefox”
keystroke “v” using command down
keystroke tab
keystroke tab
keystroke tab
keystroke tab
end tell
end tell

delay 0.3

tell application “Microsoft Excel” to activate
tell application “System Events”
tell process “Microsoft Excel”
keystroke return
end tell
end tell

delay 0.3

end repeat

———-

The Divi Theme*: https://divi-tutorials.com/divi_y
Divi Cloud*: https://divi-tutorials.com/divi_cloud
Our Webhost*: https://divi-tutorials.com/all-inkl_y
Bank for self-employed*: https://divi-tutorials.com/kontist_y
Our tip for E-Mail-Marketing*: https://divi-tutorials.com/activecampaign_y

—————-
All links marked with a * are affiliate-links. When you buy something using an affiliate-link, we may earn a small comission.

Comments are closed.