billiesoniq Posted March 1, 2019 Share Posted March 1, 2019 (edited) I am using the 'Play song' from iTunes as a workflow. The debugger shows" Quote [2019-02-28 17:37:53][ERROR: input.scriptfilter] Code 1: filters/playsong.applescript: execution error: Not authorized to send Apple events to iTunes. (-1743) I know this is an issue with Mojave and the new 'sandbox' security bubble they put around interacting with the OS; I just don't know how to give it access. Alfred is already enabled in the seurity section. Any thoughts? Edited March 1, 2019 by billiesoniq Link to comment
Andrew Posted March 1, 2019 Share Posted March 1, 2019 @billiesoniq scroll down past "Full Disk Access" in the Security & Privacy prefs, and under "Automation", make sure iTunes is ticked for Alfred. macOS should have asked automatically for you to grant this access, but if you missed the popup, it may have been left unticked, preventing Alfred's access. Cheers, Andrew Benjamin Van Ryseghem and billiesoniq 2 Link to comment
billiesoniq Posted March 1, 2019 Author Share Posted March 1, 2019 @Andrew - That was it! Thank you so much - I didnt' even know there was another 'automation' security area. Thank you for the speedy answer. I'm back in business! Link to comment
ylluminate Posted January 17, 2020 Share Posted January 17, 2020 What do you do when trying to use iTunes.app in Catalina instead of Music.app? (For those of us who won't give it up: Retroactive) I assume there's a way to force / trigger Alfred to ask for permission for other various apps (such as iTunes.app)? Sadly SizzlingKeys has still been an up and down ride (sometimes won't work at all) and so I'm left trying to use something like http://www.packal.org/workflow/itunes-seeking. Link to comment
Andrew Posted January 21, 2020 Share Posted January 21, 2020 @ylluminate If you're using Catalina, forcing iTunes isn't compatible with Alfred's default actions, but for Remote / Workflows the AppleScript for these actions is pretty simple ( see https://dougscripts.com/itunes/index.php ), so you could just recreate the actions. Alfred's mini player will only support Apple's actual app though. Link to comment
ylluminate Posted January 25, 2020 Share Posted January 25, 2020 I'm just really wanting to control the full iTunes app via key combos. Link to comment
deanishe Posted January 25, 2020 Share Posted January 25, 2020 35 minutes ago, ylluminate said: I'm just really wanting to control the full iTunes app via key combos. You can do that, but you'll have to put it together yourself with Hotkeys and AppleScripts (from the link Andrew posted above). Link to comment
ylluminate Posted January 25, 2020 Share Posted January 25, 2020 Well I think that's what I essentially did - the problem, however, is that the automation permission is not being set in Preferences... only for Music.app (see this, Music.app is the only one and I can't add more manually). I'm trying to figure out allow that script I noted above (com.tylast.itunesseeking) to actually execute. Note the screencast here wherein I show the hotkey activation of the script with the error / problem results below in the debug panel and then the source that's being used at the end: https://p153.p0.n0.cdn.getcloudapp.com/items/2Nure1om/Screen+Recording+2020-01-25+at+05.14+PM.gif And here is the skip-back script I noted from above here: on alfred_script(q) tell application "iTunes" if player state is playing then --get the current track time: set currTime to get player position if currTime < 10 then --go to start of the track: set currSkip to 0 else --otherwise, skip backwards set currSkip to currTime - 5 end if set player position to currSkip --skip to new position end if end tell end alfred_script Link to comment
deanishe Posted January 26, 2020 Share Posted January 26, 2020 I don't know anything about Catalina (I don't have it and have no intention of installing it), but you shouldn't use "Run NSAppleScript". Put your scripts in a regular Run Script action with Language = /usr/bin/osascript (AS) instead. Run NSAppleScript behaves weirdly sometimes, and it blocks Alfred, too. Don't use it unless you have a good reason to. Link to comment
ylluminate Posted January 26, 2020 Share Posted January 26, 2020 So you're saying that I should set up a new workflow that uses "Run Script" instead of "Run NSAppleScript"? So to do the following steps: 1) Workflows 2) Click "+" -> "Blank Workflow" 3) "[+]" (Set up Alfred Remote pages for this project) 4) "+" ("Add Remote Page") 5) Assign title, etc. 6) at grid, click "+" square and "Run Script" from menu. 7) select "/usr/bin/osascript (AS)" & insert script... Link to comment
deanishe Posted January 26, 2020 Share Posted January 26, 2020 Sounds about right, yes. Link to comment
ylluminate Posted July 8, 2021 Share Posted July 8, 2021 I've noticed that `Run NSAppleScript` is faster than the recommended use of `/usr/bin/osascript`. Unfortunately things have gotten weird in Big Sur where after I did a reset of `tccutil` permissions across the board Alfred no longer executes NSAppleScript due to a permission error. I see repeated recommendations to NOT use it... but I WANT to use it and would like to understand how to make it work again and get macOS to prompt for acceptation of permission. Clearly it works somehow as it did up until I reset things, so... what's the magic sauce to make it work when we want to make it work? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now