Applescript double quotes issue

Hi, I'm trying to write a script in AppleScript that increases volume but I don't know how to use double quotes properly, if anyone could help it would be great:


do shell script "osascript -e set Volume \\'10\\'"

Posted on Aug 24, 2017 11:59 PM

Reply
2 replies

Aug 25, 2017 10:03 AM in response to AK0246

You don't need to use either a do shell script or osascript to control volume in AppleScript. Just type:


set volume output volume 51 -- 51%.


See the set volume command usage in the AppleScript Language Guide.


In AppleScript, and in particular, using osascript in a do shell script invocation, the syntax is:


do shell script "osascript -e 'set volume output volume 51'"


You can reference this 2013 post that offers more osascript volume options. Just use the quoting format above. I tested some of these article entries and they still work in El Capitan 10.11.6.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript double quotes issue

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.