私は以下のスクリプトを持っています(個人情報を削除するように変更されました)。Fetchとapplescriptを使用して、どのようにすべてのファイルをダウンロードしますか?
-- This line is for testing.
set the clipboard to "1234567890"
set loginName to "username"
-- Password is stored in KeyChain (you need to do manually).
-- Create Remote path
set folderNumber to the clipboard as string
set subdir1 to character 1 of folderNumber
set subdir2 to character 2 of folderNumber
set remotePath to "/files/" & subdir1 & "/" & subdir2 & "/" & folderNumber
-- Create Local path
set homeFolder to (path to home folder) as string
set localPath to homeFolder & "LOCALSTORAGE" as string
set localStorage to localPath & ":" & folderNumber & ":" as string
-- Create Local file
tell application "Finder"
try
make new folder at localPath with properties {name:folderNumber}
on error e number n
-- Do nothing.
end try
end tell
-- Connect to FTP
tell application "Fetch"
activate
set tWindow to make new transfer window at beginning with properties {hostname:"ftpServerAddress", username:loginName, initial folder:remotePath}
tell window tWindow
download every remote item to beginning of alias localStorage
close window
end tell
quit
end tell
-- Open folder
tell application "Finder"
open localStorage
end tell
スクリプトを実行すると、次の行が失敗します。
download every remote item to beginning of alias localStorage
次のように私が手にエラーがある:
error "Fetch got an error: Can’t get every remote item of window (transfer window id 232280960)." number -1728 from every remote item of window (transfer window id 232280960)
誰もが、エラーが何を意味するかまたはそれを修正する方法を知っていますか?私は多くの運がなければフェッチのウェブサイトを試みました。 "Fetch" btwはFetch FTPクライアントです。
ありがとう!それは動作します。また、「ミラーフォルダ」オプションのappleScriptを記録できることも発見しました。それから、私はすべてを引き抜くという命令も得ました。 –