Batch Upload für Sonorasaurus
5/07/2010
Ich habe mir ja vor kurzem ein iPad zugelegt (Nelson sein Name) und war auf der Suche nach einer Player-Software, mit der ich zur Not halbwegs komfortabel Musik machen kann. Dabei bin ich auf Sonorasaurus gestoßen. Neben der File-Sync Lösung, die über USB funktioniert, ist bisher nur ein einfacher Webserver vorhanden, über den sich jeden Datei einzeln hochladen lässt. Da ich aber unbedingt über das Netzwerk schnell den ein oder anderen Song nachladen können möchte, habe ich mir hierfür.... RICHTIG, ein kleine AppleScript geschrieben. Es nutzt curl um im batch Dateien auf das iPad zu laden (aktiviert Sonorasaurus-Webserver vorrausgesetzt). Die IP des iPads stellt man über den Dateinamen (Prefs-Datei habe ich mir mal gespart) ein. Ein einfaches Droplet, Mp3-Dateien drauf-ziehen, warten, auf dem iPad abspielen =)DOWNLOADUpload to Sonorasaurus v.1.0
28.7 kB (150 hits)
--04.07.2010 hubionmac.com
--Tested with Mac OS 10.6.4
--Sonorasaurus File Upload Droplet
on open these
tell application "Finder"
set myname to name of (path to me)
end tell
set AppleScript's text item delimiters to "Upload mp3s to "
set ipad_ip to text item 2 of myname
set AppleScript's text item delimiters to ".app"
set ipad_ip to text item 1 of ipad_ip
set AppleScript's text item delimiters to ""
set server_address to "http://" & ipad_ip & ":8888"
repeat with this in these
set this_x to POSIX path of (this as alias)
set this_file to do shell script "basename " & quoted form of this_x
if this_file ends with ".mp3" then
set this_dir to do shell script "dirname " & quoted form of this_x
do shell script "cd " & quoted form of this_dir & ";curl -F \"file=@" & this_file & "\" -F \"button=Upload\" " & server_address
end if
end repeat
display dialog "finished" giving up after 4
end open