Aqui está uma pequena coisa que eu configurei para você, que exibirá um diálogo pedindo que você digite o horário para que os eventos do sistema enviem o pressionamento de tecla. Você pode salvar este script como um aplicativo e executá-lo sempre que quiser. Outra opção seria remover as primeiras duas linhas do código e substituí-lo por… property requested_time : "10:40:25 AM”
. Então você poderia simplesmente adicionar o script a um evento do iCal para lançar todos os dias no horário que você escolher
set requested_time to display dialog "Please Enter Your Start Time With The Following Format: Hour:Minutes:Seconds" default answer "10:40:25 AM" buttons {"OK"} default button 1
set requested_time to text returned of requested_time
set theTime to time string of (current date)
tell application "ProPresenter 5" to launch -- Opens The App Without Bringing It Up Upfront. Added This Line To Make Sure Your Application Is Running When System Events Sends The Keystroke. You Can Always Remove This Line If You Prefer
repeat until theTime is greater than or equal to requested_time -- Added The "Greater Than" Just As A Failsafe
delay 1
set theTime to time string of (current date)
end repeat
tell application "ProPresenter 5" to activate
delay .5 -- My system did not need this delay. Yours may not either, but I added it just in case.
tell application "System Events"
keystroke "z"
end tell
Ou você pode salvar esta versão do script como um aplicativo.
property requested_time : "10:40:25 AM”
set theTime to time string of (current date)
tell application "ProPresenter 5" to launch -- Opens The App Without Bringing It Up Upfront. Added This Line To Make Sure Your Application Is Running When System Events Sends The Keystroke. You Can Always Remove This Line If You Prefer
repeat until theTime is greater than or equal to requested_time -- Added The "Greater Than" Just As A Failsafe
delay 1
set theTime to time string of (current date)
end repeat
tell application "ProPresenter 5" to activate
delay .5 -- My system did not need this delay. Yours may not either, but I added it just in case.
tell application "System Events"
keystroke "z"
end tell
Em seguida, você pode criar um novo evento de calendário para ser repetido diariamente e, 20 minutos antes, ele lançará o script que você salvou como um aplicativo