おもろい、めずらしいアップルスクリプト発表会 6

このエントリーをはてなブックマークに追加
24名称未設定
デスクトップをftpアップロードするスクリプト
on idle
set UserName to "name" ---アカウント名
set UserPassword to "password" ---パスワード
---FTPサーバ名/ユーザ名/リモートディレクトリ、最後に"/"をつける
set FTPaddress to "f999.aaacafe.ne.jp/public_html/"

set thePDFName to "screencapture" & ".pdf"
set thePNGName to "screencapture" & ".png"
do shell script "cd $HOME/Desktop; screencapture " & quoted form of thePDFName
do shell script "cd $HOME/Desktop; sips -s format png " & quoted form of thePDFName & " --out " & quoted form of thePNGName
do shell script "cd $HOME/Desktop; rm -f " & quoted form of thePDFName

tell application "URL Access Scripting"
activate
set fullPath to ((path to desktop) as text) & thePNGName
set FTPURL to ("ftp://" & UserName & ":" & UserPassword & "@" & FTPaddress)
upload file fullPath to FTPURL replacing yes with progress without binhexing
quit
end tell
return 20
end idle