Jump to content

Encoding Backslash in AppleScript inside Bash


odetinin

Recommended Posts

I have a need to have this snippet in my bash workflow:

 

osascript <<EOT
set myString to "This\\ is\\ string"
return myString
EOT
 
It breaks with error:

[ERROR: alfred.workflow.action.script] Code 1: 22:23: syntax error: Expected “"” but found unknown token. (-2741)

 

 

I would like the output string to look like "This\ is\ string".

Link to comment
Share on other sites

  • 4 weeks 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...