-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toggle on and off via AppleScript #43
Comments
You are right, I should probably integrate some scripting definitions to be a good Cocoa and AppleScript citizen. I'll do some research if it is easily possible to ship basic AppleScript support in the next release. I'll report any findings here. Thanks for reminding me 😀 |
Awesome! Thank you, sir 👍 |
I'm sorry for the delay, but I became absolutely discouraged from developing this feature when I saw how these AppleScript APIs and scripting definitions should be implemented 😭. I'll have a look at this year's AppleScript-related WWDC sessions to see if there is anything new in there to make my life easier implementing scripting support. I'll update this issue when I've gathered new insights into AppleScript. Thanks for your patience! |
Just to add - I would very much like this too if it's something that's still on the cards. |
Or is there a way to do it in AppleScript can then call the bash script (or some command line tool) to achieve the same thing. |
My use case was I wanted to reset the countdown to 5 hours via a bash script, which is how I got here. To workaround not being able to AppleScript it, I just set the default activation period to 5 hours, then close and reopen the app from Bash. Easy peasy! |
Is there still not a simple way to toggle KeepingYouAwake from the command line? I've been using Lungo only because it has a CLI for this. |
@AlecRust Since version 1.3.0 you can use URL schemes to control KYA from the command line, e.g.
(please note the quotes when using zsh) Is that insufficient for your use case? If that is the case I would even recommend using Apple's |
Oh that's great, thanks! |
it wasn't entirely obvious to me but looking thru the source code, i found out that there is also open "keepingyouawake:///toggle" to, you guessed it, toggle activation state. |
FYI on 1.6.5 at least to make this work consistently I had to do |
Hello!
Previously, with Caffeine, I was able to use the following AppleScript to toggle it on and off via the keyboard:
When trying that with this application (subbing
"Caffeine"
with"KeepingYouAwake"
), it doesn't work. Using the Script Editor application, it seems that theactive
variable is not present. As far as I can tell, there aren't any available actions when using the Script Editor Dictionary, but I thought I'd confirm here.The text was updated successfully, but these errors were encountered: