Jump to content

Script Filter (osascript): no option for escaping backslash [Fixed 2.0.3 b184]


Recommended Posts

Posted (edited)

Maybe it can’t be labeled as an Alfred bug but it seems an important feature is missing to properly work with Apple scripts.
 
Steps:
 
1. Download the Test Workflow
2. Double click Script Filter (the Language is /usr/bin/osascript)
3. Escaping: there is Double Quotes but not a Backslash to check. Backslash also has a special meaning within an Apple script and it needs to be escaped.
 
Test:
 
1. bring Alfred
2. type the workflow keyword zz
3. typing a single backslash will freeze the workflow or the default Alfred search will take place
 
 
If you uncheck Double Quotes in Script Filter Escaping settings the same will happen.
 
This also happens if I use the language /bin/bash and the command osascript to run an Apple script.
 
backslash.png

Edited by Carlos-Sz
Posted

Maybe it can’t be labeled as an Alfred bug but it seems an important feature is missing to properly work with Apple scripts.

 

Steps:

 

1. Download the Test Workflow

2. Double click Script Filter (the Language is /usr/bin/osascript)

3. Escaping: there is Double Quotes but not a Backslash to check. Backslash also has a special meaning within an Apple script and it needs to be escaped.

 

Test:

 

1. bring Alfred

2. type the workflow keyword zz

3. typing a single backslash will freeze the workflow or the default Alfred search will take place

 

 

If you uncheck Double Quotes in Script Filter Escaping settings the same will happen.

 

This also happens if I use the language /bin/bash and the command osascript to run an Apple script.

 

 

Alfred 2.0.3 b184 is now in pre-release from the in-app auto-updater, including an improvement for this, so please update to test :)

Posted

Alfred 2.0.3 b184 is now in pre-release from the in-app auto-updater, including an improvement for this, so please update to test :)

 

I made some tests and now Language “/usr/bin/osascript” works as expected!

 

Thank you!

Posted

Alfred 2.0.3 b184 is now in pre-release from the in-app auto-updater, including an improvement for this, so please update to test :)

 

I’m not sure if b184 did the same but typing double quotes will break the script even if the language is “/usr/bin/osascript”.

 

You can reproduce the double quote not escaping issue in the test workflow I posted initially.

 

Backslash is working fine.

Posted

I’m not sure if b184 did the same but typing double quotes will break the script even if the language is “/usr/bin/osascript”.

 

You can reproduce the double quote not escaping issue in the test workflow I posted initially.

 

Backslash is working fine.

 

Ah D'oh! I can totally see why this is happening! I need to escape backslashes in the string before escaping anything else otherwise all the other escaping gets escaped.

 

I'll fix this in the next hour or so... thanks for spotting! :)

Posted

I’m not sure if b184 did the same but typing double quotes will break the script even if the language is “/usr/bin/osascript”.

 

You can reproduce the double quote not escaping issue in the test workflow I posted initially.

 

Backslash is working fine.

 

Update to pre-release b187 and that should now be fixed :)

Posted

Ah D'oh! I can totally see why this is happening! I need to escape backslashes in the string before escaping anything else otherwise all the other escaping gets escaped.

 

I'll fix this in the next hour or so... thanks for spotting! :)

 

Great! It’s working now (b187). That was fast! :)

 

Thank you.

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