
Apple 스크립트가 나에게 필요한 것인지는 확실하지 않지만 필요한 대부분의 작업을 수행하는 것 같습니다. 자유롭게 대안을 제시해 보세요.
카운트다운 비디오를 시작하려면 정확한 시간에 프로그램에 캐릭터를 보내야 합니다. 내가 가지고있는 Apple 스크립트는 다음과 같습니다.
tell application "ProPresenter 5"
activate
end tell
tell application "System Events"
keystroke "z"
end tell
나에게 필요한 것은 어느 날 10시 40분 25초에 시작하고 다음 날 10시 40분 15초에 시작할 수 있어야 한다는 것입니다. 내가 보는 모든 가이드에는 달력이나 자동화 기능이 포함되어 있지만 해결 방법은 1분입니다. 그리고 약 20분 전에만 설정하면 돼요
중요한 경우 나는 os x 10.8.5를 사용하고 있습니다.
답변1
다음은 시스템 이벤트가 키 입력을 보낼 시간을 입력하라는 대화 상자를 표시하도록 설정한 것입니다. 이 스크립트를 응용 프로그램으로 저장하고 원할 때마다 실행할 수 있습니다. 또 다른 옵션은 코드의 처음 두 줄을 제거하고 다음과 같이 바꾸는 것입니다 property requested_time : "10:40:25 AM”
. 그런 다음 iCal 이벤트에 스크립트를 추가하여 매일 원하는 시간에 실행할 수 있습니다.
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
또는 이 버전의 스크립트를 앱으로 저장할 수 있습니다.
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
그런 다음 매일 반복할 새 캘린더 이벤트를 생성할 수 있으며, 20분 전에 앱으로 저장한 스크립트가 실행됩니다.
답변2
AppleScript delay
명령을 사용하면 스크립트가 정확한 분에 실행되는 것을 몇 초만큼 지연시킬 수 있습니다.
귀하의 예에 따라: 10:40:25에 실행하려면 ... 10:40:00에 실행되도록 스크립트를 설정하되 delay 25
첫 번째 줄에 명령을 입력하십시오.