Adding existing AE keyboard shortcuts to actions

Hi @david , I managed to find a way to trigger a keyboard key press (in your case the letter “p”) natively using a Apple Script on mac and PowerShell on windows.

In Windows the process is match simpler, on a mac there are a few steps you need to follow, also because I am not using mac so I had to figure out how it works.

You can do it with these 6 simple steps:

  1. create “key press” apple script.
  2. export the script as application.
  3. set the security & privacy settings for this application.
  4. import the automation.
  5. set the automation properties.
  6. disable after effects warning for executing a file.
  7. done!

I created a video that shows how to set it up and complete all the steps:
(I am using a mac virtual machine so everything is very laggy and slow on my side)

This is the apple script code:

tell application "System Events"
	tell application process "After Effects"
		activate
		set frontmost to true
		tell application "System Events" to keystroke "p"
	end tell
end tell

Download the automation:
key press.json (4.8 KB)

keep in mind that a keyboard key press can happen only in the end of an automation when the application is free, because while an automation is running the application freezes so any mouse or keyboard event cannot affect the software so if you need to add lines to the automation add them before.

Let me know if it worked and if you have any questions,
Thanks,
Alon