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\\'"
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\\'"
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.
I do not think you need to do anything fancy with the quotes.
On the command line (in the application Terminal) you can enter:
sudo osascript -e "set Volume 5"
then you have to enter your admin password
I have not been able to get this to work in AppleScript
Applescript double quotes issue