I’m very new to applescript, but I tried to make the code as clear as possible.
Basically, Minuteur is a egg timer application, and has a full screen timer mode. I want to make a script that turns on full screen mode,
starts a countdown (time for working), and after that ends, turn off full screen mode and start another countdown (break time).
The problem is, the second time the full_screen() function is called, there’s a system beep to signal an illegal keystroke and nothing happens. If its at all obvious, what am I doing wrong here? Thanks in advance for any help.
-- string is in "hhmmss" format
set _duration to "000010"
set _duration_as_int to 10
set _break to "000010"
set _break_as_int to 10
tell application "Minuteur"
activate
end tell
full_screen()
-- start work countdown
tell application "Minuteur"
StartCountdown _duration
end tell
-- turn off full screen 3 seconds before alarm rings
delay (_duration_as_int - 3)
full_screen()
-- after alarm ends, let ring for 3 seconds
delay 6
-- start break countdown
tell application "Minuteur"
StartCountdown _break
end tell
-- let ring for 3 seconds
delay (_break_as_int + 3)
-- pause the timer
tell application "Minuteur"
Pause
end tell
-- pressing cmd-f in Minuteur toggles full screen view
on full_screen()
tell application "System Events"
keystroke "f" using command down
end tell
end full_screen