Created
June 30, 2009 07:16
-
-
Save jubishop/138047 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "iTunes" | |
copy (convert current track) to newTrack | |
set newLocation to (location of track 1 of current playlist) | |
tell application "Finder" | |
copy (move newLocation to the desktop with replacing) to newFile | |
end tell | |
delete (track 1 of current playlist) | |
do shell script "uptmp " & quote & (POSIX path of newLocation) & quote | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'rbosa' | |
raise "Need file name" if (ARGV.empty?) | |
fileName = ARGV.first | |
uploadDir = ARGV[1] || (File.extname(fileName) == ".mp3" ? "music" : "tmp") | |
IO.popen("scp '#{fileName}' [email protected]:~/WebServer/public/#{uploadDir}") {|io| io.read } | |
IO.popen("rm '#{fileName}'") { |io| io.read } | |
safari = OSA.app('Safari') | |
safari.make OSA::Safari::Document | |
document = safari.documents.last | |
documents = safari.documents.to_a | |
if (File.extname(fileName) == ".swf") | |
document.url = "http://jubishop.com/Flash.html?swf=#{uploadDir}/" + | |
File.basename(fileName) | |
else | |
document.url = "http://jubishop.com/#{uploadDir}/" + | |
File.basename(fileName) | |
end | |
safari.activate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment