Jump to content

`open location` not working (`osascript (AS)`)


vitor

Recommended Posts

I could swear this was working a few weeks ago, and then it stopped working. If I have a Run Script with /usr/bin/osascript (AS) and open location "https://www.alfredforum.com/" it errors out with execution error: "https://www.alfredforum.com/" doesn’t understand the “open location” message. (-1708). If the code is in a Run NSApplescript there’s no error, but nothing happens.


The code works fine in Script Editor, just not in Alfred.


Here’s a ready made workflow.

Link to comment
Share on other sites

Hi Vitor,

 

This seems to be working fine for me with RunScript / osascript (AS), but not for Run NSAppleScript. I've actually put a bit of debug code in and NSAppleScript is returning no errors to me, i.e. reporting that it ran fine. I wonder if something has changed in macOS if this previously worked in Run NSAppleScript.

 

I'll continue to fiddle.

 

Cheers,

Andrew

Link to comment
Share on other sites

12 minutes ago, Andrew said:

I wonder if something has changed in macOS if this previously worked in Run NSAppleScript.

 

To be clear, I hadn’t tried in Run NSAppleScript before. I just did so now for the sake of completeness on the report.


This occurs on a seldom used workflow of mine, so unfortunately I don’t know exactly when it stopped working. It’s quite possible I’ve updated macOS and/or Alfred in the meantime since it worked.


Also, for now I have an acceptable workaround by using an Open URL before the rest of the code. So at least for me, having this fixed is low priority. I’m mostly reporting the issue in case it’s something deeper that needs to be fixed in Alfred.


Thank you as always for the fast response.

Link to comment
Share on other sites

@vitor I'm going to move this to noted, but it's unlikely there is anything I'll fix for this. I'm not even sure if it's valid AppleScript, as when I run osascript directly from the command line, I get the same thing:

Andrews-iMac:~ andrew$ osascript -e 'open location "https://www.alfredforum.com/"'
0:44: execution error: "https://www.alfredforum.com/" doesn’t understand the “open location” message. (-1708)

If I direct the open location to a specific app such as Safari or Finder (i.e. with tell), then it works as expected.

 

Cheers,

Andrew

Link to comment
Share on other sites

2 hours ago, Andrew said:

when I run osascript directly from the command line, I get the same thing

 

I can reproduce this. Strange. Well, definitely not an issue with Alfred, then. I’ll open a bug report with Apple.

 

Thank you for looking into it.

Link to comment
Share on other sites

I’ve opened this as a bug report with Apple and they closed it as a duplicate of another bug that is still open.

 

To me that suggests this behaviour did indeed change on their part (as I mentioned in the top post, I could swear this used to work in the very same Workflow it fails now) and that they intend to fix it.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

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...