External Tool: Double quotes in Parameters

Hi,

I try to set up an external tool where I need to use double quotes. (The executable I’d like to call is “osascript” on Mac OS X, wich executes AppleScript code. As AppleScript uses double quotes for some things, I can’t use single quote instead.)

However, when I enter any double quotes in the “Edit Tool” dialog’s “Parameters” field, they are removed when the tool is executed. (Which may not be a big surprise, given that the documentation says that double quotes should be used for arguments that contain spaces.) The funny thing is that when I try to escape a double quote character quotes using a backslash, both the backslash AND the double quote are in the ouput.

Examples:

Program: /usr/bin/osascript
Parameters: -e 'tell application "Finder" to activate'
Executes: /usr/bin/osascript -e 'tell application Finder to activate'

Program: /usr/bin/osascript
Parameters: -e 'tell application \"Finder\" to activate'
Executes: /usr/bin/osascript -e 'tell application \"Finder\" to activate'




Program: /usr/bin/osascript
Parameters: "-e 'tell application \"Finder\" to activate'"
Executes: /usr/bin/osascript -e 'tell application \"Finder\" to activate'



What I’d need is simply:
/usr/bin/osascript -e 'tell application "Finder" to activate'

Do I really have to write a wrapper shell script to work around this?

Carsten
2 comments
Comment actions Permalink

Hello C B,

The funny thing is that when I try to escape a double quote character quotes using a backslash, both the backslash AND the double quote are in the ouput.

Please submit an issue - http://youtrack.jetbrains.net/issues/WI#newissue=yes

Thank you for feedback!

0

Please sign in to leave a comment.