Batch Upload für Sonorasaurus

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 =)DOWNLOAD
Upload to Sonorasaurus v.1.0
28.7 kB (158 hits)
Code zum markieren einmal anklicken Code im Skript-Editor öffnen

--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

This entry was posted in AppleScript, Useful Snippets and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA:


5 × five =

Subscribe without commenting

  • Seite übersetzen:


    Paypal for Pizza:




  • Kategorien


  • Letzte Kommentare

    • Niklas: Vielen Vielen Dank! So klappt es!
    • hubi: Servus Niklas, ich habe mir den Quellcode noch einmal angesehen und habe nun unter 10.7.3 einen Weg gefunden...
    • Niklas: Klingt super das Script. Leider bekomm ich immer folgende Fehlermeldung: error “„Mail“ hat einen Fehler...
    • Jürgen: Hallo Hubi, beim Abfragen von Kennworten gibt es noch eine böse Falle: Das Format, in dem security antwortet,...
    • hubi: Am einfachsten Du öffnest im AppleScript-Editor mal das Funktionsverzeichnis (unter Ablage) von iTunes. Ein...