Jump to content
Sign in to follow this  

Workflow using Applescript not working in Mojave

Recommended Posts

Hey guys,


Part of one of my workflows, when triggered via a keyboard shortcut, pauses any audio/video that's playing and changes the volume on my computer.


Here's the (basic) script:


on alfred_script(q)
--Check App Status, to only act on apps if running
tell application "System Events" to set SkypeIsRunning to (count of (every process whose name is "Skype")) > 0
if application "iTunes" is running then
	tell application "iTunes"
	end tell
end if
if application "Spotify" is running then
	tell application "Spotify"
	end tell
end if

if application "Plex Media Player" is running then
	activate application "Plex Media Player"
	tell application "System Events"
		key code 49
	end tell
end if
set curVolume to get volume settings
if output muted of curVolume is false then
	set volume with output muted
	set volume without output muted
end if
end alfred_script

It doesn't seem to work anymore in Mojave, likely due to permissions, though I went through the permissions doc (https://www.alfredapp.com/help/getting-started/macos-mojave/) and confirmed Alfred has the right permissions in Privacy for both Accessibility, Full Disk Access and Automation.


But yet my script doesn't work.


Anyone have any suggestions to try?

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  
  • Create New...