]> sipb.mit.edu Git - snippets/.git/blob - sipbmp3-itunes/Set sipbmp3 volume.applescript
f6423c913aa39e767a6707cc9dc93a81c25bb1bb
[snippets/.git] / sipbmp3-itunes / Set sipbmp3 volume.applescript
1 -- Changelog:
2 --
3 -- 5 April 2009 -> pquimby created initial version
4 --
5 -- Installation:
6 --
7 -- 1) Launch the Printer Setup Utility and add
8 --    an IP Printer with the LPD protocol with
9 --    the following information:
10 --     Address: zygorthian-space-raiders.mit.edu
11 --     Queue: sipbmp3
12 --    It is not necessary to specify the driver.
13 --    Be sure the name of the printer is sipbmp3 or 
14 --
15 -- 2) Create the directory ~/Library/iTunes/Scripts
16 --    and place the "Send to sipbmp3.scpt" file
17 --    within.
18 --
19 -- Usage:
20 --  This script will set the volume of sipbmp3 (assuming you have remctl) to your iTunes volume scaled to the max value of 31 (which is the max volume for sipbmp3 at the time this script was written).
21
22 -- Ex:// If your iTunes volume is set at 50% then you will set the sipbmp3 volume to .50*31 or roughly 15.
23
24 tell application "iTunes"
25         set vol to (sound volume * 31 / 100)
26 end tell
27
28 set command to "/usr/local/bin/remctl zsr volume set " & vol
29 do shell script command