Jump to content

AppleScripts don't always run as expected


Subject22
 Share

Recommended Posts

Things have probably run as far as they're going to in this thread, so I thought I'd post it as a bug report. Here's a quick summary:

An AppleScript I wrote does not behave as expected when run from Alfred's Run Script action. The same script runs as expected from AppleScript Editor. The script runs as expected via Alfred's NSApplescript action once it has been cached in memory (i.e.: the initial run with caching fails, but all subsequent runs behave as expected, until Alfred is restarted). Saving the script to the workflow's directory and calling it with a bash script via Alfred's Run Script action seems to be the best workaround. See the linked thread for more details and examples.

Edited by Subject22
Link to comment
Share on other sites

Things have probably run as far as they're going to in this thread, so I thought I'd post it as a bug report. Here's a quick summary:

 

An AppleScript I wrote does not behave as expected when run from Alfred's Run Script action. The same script runs as expected from AppleScript Editor. The script runs as expected via Alfred's NSApplescript action once it has been cached in memory (i.e.: the initial run with caching fails, but all subsequent runs behave as expected, until Alfred is restarted). Saving the script to the workflow's directory and calling it with a bash script via Alfred's Run Script action seems to be the best workaround. See the linked thread for more details and examples.

 

This is unlikely a bug in Alfred, more an unavoidable behaviour thing. Would you mind not raising things like this as a bug until the investigation has been fully exhausted (i.e. the linked thread). Moving this to Closed for now pending the outcome of the other thread.

Link to comment
Share on other sites

Sure. Sorry, I thought that's what I'd done, given that things seemed to have gone quiet in that thread :-) In future you'd rather I wait a bit longer?

 

Ugh, maybe it's a good thing this is being closed. I just noticed that spelling mistake in the title. It'll bug me every time I look at it now :P

Link to comment
Share on other sites

Sure. Sorry, I thought that's what I'd done, given that things seemed to have gone quiet in that thread :-) In future you'd rather I wait a bit longer?

 

Ugh, maybe it's a good thing this is being closed. I just noticed that spelling mistake in the title. It'll bug me every time I look at it now :P

 

I'm trying to keep the bugs sub-forum as focused as possible as every bug raised in there can take me quite some time to investigate (which cuts time for Alfred general development).

 

I don't believe this is a bug in Alfred as he simply passes your AppleScript to NSAppleScript or osascript without doing anything to it. If this particular script isn't working (where all others are), then you may just have to find a workaround as there isn't anything which can be fixed in Alfred.

Link to comment
Share on other sites

That sounds perfectly reasonable to me. It was an honest mistake on my part :-) I've got a workaround, fortunately (thanks to Carlos-Sz), I just thought it was peculiar that it worked once the script was cached, and if it was called from outside Aflred (which I suppose includes the case where it is cached). Thanks for looking into this anyway!

Link to comment
Share on other sites

That sounds perfectly reasonable to me. It was an honest mistake on my part :-) I've got a workaround, fortunately (thanks to Carlos-Sz), I just thought it was peculiar that it worked once the script was cached, and if it was called from outside Aflred (which I suppose includes the case where it is cached). Thanks for looking into this anyway!

 

No worries, glad you have it working :)

Link to comment
Share on other sites

Ugh, maybe it's a good thing this is being closed. I just noticed that spelling mistake in the title. It'll bug me every time I look at it now :P

 

That made me laugh. If you go to your top post, pick Edit, and then Use Full Editor, you can correct the title.

Link to comment
Share on other sites

I tried :-/ Seems I'm no longer able to change it.

 

I’d say it’s because the thread is closed, but for that to be the case we shouldn’t be able to post replies, either. Maybe it’s just how the forum’s software works.

Link to comment
Share on other sites

I suspect it has something to do with the thread being moved to this sub-forum.

EDIT: Wait!! I lie! I can change it from the mobile site! I swear I wasn't able to do that from the desktop version. But perhaps I just missed it at the time :-)

Edited by Subject22
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
 Share

×
×
  • Create New...