Jump to content

Sounds no longer playing via script


theboyler

Recommended Posts

I have a workflow which plays a short sound file using a do shell script command in an applescript. It was previously working fine playing the sound file. Since the last update, sounds are working. 

 

When I run with the debugger, all is well - the workflow completes but no sound. When I run the script from the workflow in Script Editor, it works fine, and plays the sound. 

Link to comment
Share on other sites

Please upload your Workflow somewhere so we can have a look. We don’t know how you’re playing sounds, so for all we know it’s something that changed in macOS and not Alfred, or your code is now invalid.

 

Also, post your exact Alfred version and macOS versions. Without that it’s impossible to debug something that used to work because there’s no definition of when “previously” was.


Read the Reporting Problems with Workflows topic, as it gives a nice overview on how to build an effective report.

Link to comment
Share on other sites

OK - I'm using OS X 11.1, Alfred 4.3.1

 

Workflow uploaded here. When I say previously I mean that on Wednesday when I made the workflow, it worked fine. Now it doesn't work. 

 

I'm playing sounds using inbuilt speakers; I'm getting system alert sounds, new message sounds etc, so I know the speakers are working fine, and there's no issues with those. The fact that the script is working fine inside script editor tells me this is so too. I've not noticed any other apps have sounds probs, so at this stage, it _seems_ like it could be an Alfred issue.

Link to comment
Share on other sites

42 minutes ago, theboyler said:

When I say previously I mean that on Wednesday when I made the workflow, it worked fine. Now it doesn't work. 

 

What changed? Did you update macOS or Alfred?

 

Three things immediately jump at me:

  1. Do not use Run NSAppleScript. It’s often the case of odd behaviour and almost never the right choice. Instead, use a Run Script with /usr/bin/osascript (AS) as the language.
  2. You have Application\\ Support in there. That’s escaping the backslash, not the space (i.e. you have one backslash too many). Better yet, do proper quoting: do shell script "afplay '/Users/daveboyle/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.08DFEAE1-698D-4B9E-900B-4647E46FF74F/ohyeah.m4a'".
  3. Ensure user.workflow.08DFEAE1-698D-4B9E-900B-4647E46FF74F is still the correct directory for the Workflow, lest you have renamed it to something else. Instead of storing data inside the Workflow itself, use the proper directories (alfred_workflow_data) (see [HOW TO] Workflow/environment variables).
Link to comment
Share on other sites

Hi Vitor,

 

No update of macOS in this period; I think Alfred might have updated; the changelog says no change since 22nd jan, but I know it updated to a beta version more recently than that.

 

Changing the script to run in a run script  doesn't change anything, nor does using the quoted form of the filename; the correct directory is referenced in the workflow.

Link to comment
Share on other sites

8 minutes ago, theboyler said:

but I know it updated to a beta version more recently than that.

 

Then it’d be useful to know which. Just noticed you haven’t posted the exact versions above. Especially if this is caused by a regression in a beta, that is imperative. Alfred’s version should be something like 4.3.1 [1214]. That second number is what matters most.

 

If you download the stable version from the website, does the Workflow run again?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...