[3fde6d5] | 1 | -- ----------------- |
---|
[e520009] | 2 | -- iTunes -> gutenbach |
---|
[3fde6d5] | 3 | -- ----------------- |
---|
| 4 | -- This is a simple little script which sends |
---|
[e520009] | 5 | -- music from an iTunes library to the gutenbach |
---|
[3fde6d5] | 6 | -- lpr server. |
---|
| 7 | -- |
---|
| 8 | -- Changelog: |
---|
| 9 | -- |
---|
[a9e08a4] | 10 | -- 23 Aug 2009 -> broder spun loop into shell script instead of |
---|
| 11 | -- applescript so that iTunes doesn't hang |
---|
[3fde6d5] | 12 | -- 9 Jan 2009 -> price added 'quoted form' |
---|
| 13 | -- 7 Jan 2009 -> kmill created initial version |
---|
| 14 | -- |
---|
| 15 | -- Installation: |
---|
| 16 | -- |
---|
| 17 | -- 1) Launch the Printer Setup Utility and add |
---|
| 18 | -- an IP Printer with the LPD protocol with |
---|
| 19 | -- the following information: |
---|
| 20 | -- Address: zygorthian-space-raiders.mit.edu |
---|
[e520009] | 21 | -- Queue: gutenbach |
---|
[3fde6d5] | 22 | -- It is not necessary to specify the driver. |
---|
| 23 | -- |
---|
| 24 | -- 2) Create the directory ~/Library/iTunes/Scripts |
---|
[e520009] | 25 | -- and place the "Send to gutenbach.scpt" file |
---|
[3fde6d5] | 26 | -- within. |
---|
| 27 | -- |
---|
| 28 | -- Usage: |
---|
| 29 | -- |
---|
| 30 | -- When in iTunes, select the songs which you |
---|
| 31 | -- would like to hear in the office, and click |
---|
[e520009] | 32 | -- "Send to gutenbach" in the script menu from |
---|
[3fde6d5] | 33 | -- the menu bar. The script menu looks like a |
---|
| 34 | -- little scroll icon. There will be no |
---|
| 35 | -- feedback beyond the pleasant sounds you now |
---|
| 36 | -- hear around you. |
---|
| 37 | |
---|
[a9e08a4] | 38 | set ts to "" |
---|
[3fde6d5] | 39 | |
---|
| 40 | tell application "iTunes" |
---|
| 41 | repeat with t in selection |
---|
| 42 | if class of t is (file track) then |
---|
| 43 | set loc to POSIX path of (get location of t) |
---|
[a9e08a4] | 44 | set ts to ts & " " & (quoted form of loc) |
---|
[3fde6d5] | 45 | end if |
---|
| 46 | end repeat |
---|
| 47 | end tell |
---|
| 48 | |
---|
[e520009] | 49 | set command to "(for t in " & ts & "; do lpr -o raw -Pgutenbach \"$t\"; done) >/dev/null 2>&1 </dev/null &" |
---|
[a9e08a4] | 50 | do shell script command |
---|