Переместите файлы с помощью Applescript для передачи по FTP - PullRequest
0 голосов
/ 23 ноября 2018

Я полностью застрял с проблемой appleScript.Попытка использовать его для автоматической загрузки из папки на удаленном FTP-сервере в локальную папку.После загрузки я хочу переместить файлы на сервере в подпапку, чтобы потом не загружать их снова.Код следующий:

tell application "Transmit"

    set SuppressAppleScriptAlerts to true

    set Favourite to item 1 of (favorites whose name is "Auto-Sync")

set myRules to (skip rules whose enabled is true)

tell current tab of (make new document at end with properties {name:"ActiveAutoSync"})

    connect to Favourite

    refresh remote browser
    refresh local browser

    tell remote browser

        if exists "__AutoCollected" then
            --
        else
            create folder named "__AutoCollected"

        end if

    end tell

    repeat while (exists document "ActiveAutoSync" of application "Transmit")

        with timeout of 3600 seconds
            synchronize remote browser to local browser using skip rules myRules with compare using size and follow symlinks
        end timeout

        set folderName to ("__AutoCollected")
        tell remote browser
            set theFiles to (the name of every browser item whose item type is file item)
            repeat with thisFile in theFiles
                move (file whose name is thisFile) to folder whose name is folderName
            end repeat
        end tell

        delay 30

    end repeat

    end tell

end tell

Все запускается файл, пока я не достиг строки move .Я пробовал все виды комбинаций массива, устанавливая его в виде строки, псевдонима и т. Д., Но каждый раз это другая ошибка - в основном, как

Не удается получить файл с именем = item1 из {\ "file1.JPG \", \ "file2.JPG \", \ "file3.JPG \"

Я подозреваю, что в команде Transmit есть что-то отличное от того, что я использовалк, но я просто не могу понять это из документации в словаре.У кого-нибудь есть идеи?

Спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...