-
Notifications
You must be signed in to change notification settings - Fork 691
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
Apple script additions #457
Conversation
Sorry, only just saw this. I've had a quick read through most of it and it looks great. I'll try to read it properly and test it out tomorrow so I can merge it. |
Co-authored-by: Kyle Neideck <[email protected]>
Co-authored-by: Kyle Neideck <[email protected]>
Co-authored-by: Kyle Neideck <[email protected]>
Co-authored-by: Kyle Neideck <[email protected]>
I left a few more comments about tiny things, but I've finished reading through the code and tested it and it all looks good to me. Happy to merge it whenever you're ready. |
Co-authored-by: Kyle Neideck <[email protected]>
Co-authored-by: Kyle Neideck <[email protected]>
Merged, thanks again. I've been wanting to add these features to the AppleScript API for ages, so I'm very happy to get this PR in. |
i try it . but receive err: |
Did you try some other apps? Maybe it's just not working for Zoom for some reason. I only tested it with Music.app. (Used to be called iTunes.app.) |
i try Music. same to zoom.us
result is :error "“Background Music”遇到一个错误:不能获得“audio application 1 whose name = "Music"”。无效的索引。" |
Maybe the app name is localized for you. Is it called "Music" in the menu in Background Music? You can list all of the apps like this:
Is "Music" one of the names in that list for you? |
Oh, that's very true -- I am using the localized app name property so any internationalization in the app name will affect how to reference an application. |
That's true. Music display in Chinese '音乐'.Now it run success. Thank you very much. |
I just added a bundle ID property, so now you have the option of looking up the app by its bundle ID as well: tell application "Background Music"
-- get the bundleID of every audio application
set vol of (a reference to (the first audio application whose bundleID is equal to "com.apple.Safari")) to 15
end tell I think the bundle ID should be pretty stable for most apps and it won't be localized, so it might work better, depending on your use case. Or you could try one and fallback to the other if it fails. |
These changes allow for additional scripting such as:
#326
#449