{"id":14700,"date":"2013-01-05T23:58:10","date_gmt":"2013-01-05T22:58:10","guid":{"rendered":"http:\/\/krabat.menneske.dk\/kkblog\/?p=14700"},"modified":"2020-06-13T00:27:56","modified_gmt":"2020-06-12T23:27:56","slug":"auto-upload-to-ftp-folder-with-cyberduck","status":"publish","type":"post","link":"https:\/\/krabat.menneske.dk\/kkblog\/2013\/01\/05\/auto-upload-to-ftp-folder-with-cyberduck\/","title":{"rendered":"Auto-Upload to FTP folder with Cyberduck"},"content":{"rendered":"<div class=\"_22fn0\">\n<div class=\"_2m1qj\">\n<p>[Don&#8217;t know, if Windows users will have any use of this. Sorry.)<\/p>\n<\/div>\n<div class=\"_2m1qj\">\n<p>I use this on a Mac OSX.4.11 installation, and it <em>should<\/em> work all the way up to OSX.8.<\/p>\n<\/div>\n<div class=\"_2m1qj\">\n<p>The <a href=\"https:\/\/t.umblr.com\/redirect?z=http%3A%2F%2Fwww.cyberduck.ch%2F&amp;t=YzQ2NDUzNGMzMWFjMmMzNTcwNWVhYmM2YjIwMWNhMTcyNDA4ZDRjZSw5ODY4MzViNGRmZTJkODM4MmZhZTk1Yzc1MjNiY2ZjYmIzMDkzMGVk\" target=\"_blank\" rel=\"noopener noreferrer\">Cyberduck<\/a> FTP upload AppleScript, which <a href=\"https:\/\/t.umblr.com\/redirect?z=http%3A%2F%2Fwww.chrispie.com%2Fblog%2Fupload-a-folder-with-cyberduck-349%2F&amp;t=MjI4ZmMwMzU0YTAwNDYxN2NiOTUxZGY0YWU0YTQxMGMxOTEyYzI1ZCw0YTU2Y2MwNjVkNTYxYzViZWU3ODUwMmFiMjg4ZWJjNDkwMmMwZThk\" target=\"_blank\" rel=\"noopener noreferrer\">chrispie.com<\/a> had modified, I have further modified and now very flattering call AutoUpload2FTPwCyberduck. This means it does not sync &#8211; it simply auto-uploads things, which are added to a designated folder.<\/p>\n<\/div>\n<div class=\"_2m1qj\">\n<p>Once you have placed the script in (HD)\/Library\/Scripts\/Folder Action Scripts, and attached the script to a folder of your choice via Folder Actions (Ctrl+Folder Actions), AU2FTPwC goes to work.<\/p>\n<\/div>\n<div class=\"_2m1qj\">\n<p>WHAT IT DOES<\/p>\n<\/div>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"_2m1qj\">\n<p>&#8212;<\/p>\n<\/div>\n<div class=\"_2m1qj\">\n<p>Open a new document in Script Editor and insert the following. Edit the info in <strong>bold<\/strong>, and then save it in (HD)\/Library\/Scripts\/Folder Action Scripts:<\/p>\n<\/div>\n<div class=\"_2m1qj\">\n<p>&#8212; &gt; From here<\/p>\n<\/div>\n<div class=\"_2m1qj\">\n<p>&#8212; Copyright (c) 2004 David Kocher. All rights reserved. &#8212; http:\/\/cyberduck.ch\/ &#8212; &#8212; This program is free software; you can redistribute it and\/or modify &#8212; it under the terms of the GNU General Public License as published by &#8212; the Free Software Foundation; either version 2 of the License, or &#8212; (at your option) any later version. &#8212; &#8212; This program is distributed in the hope that it will be useful, &#8212; but WITHOUT ANY WARRANTY; without even the implied warranty of &#8212; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the &#8212; GNU General Public License for more details. &#8212; &#8212; Bug fixes, suggestions and comments should be sent to: &#8212; dkocher@cyberduck.ch on adding folder items to this_folder after receiving added_items \u00a0\u00a0\u00a0 delay 300 \u00a0\u00a0\u00a0 set theServer to &#8220;<strong>your.FTP.server<\/strong>&#8221; \u00a0\u00a0\u00a0 set theUser to &#8220;<strong>yourlogon<\/strong>&#8221; \u00a0\u00a0\u00a0 set thePassword to &#8220;<strong>yourpassword<\/strong>&#8221; \u00a0\u00a0\u00a0 set theProtocol to &#8220;ftp&#8221; \u00a0\u00a0\u00a0 set theUploadFolder to &#8220;<strong>youruploadfolder<\/strong>&#8221;<\/p>\n<\/div>\n<div class=\"_2m1qj\">\n<p>&#8212; NB: Create the upload folder on your server, before using the script. \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 set the item_count to the number of items in the added_items \u00a0\u00a0\u00a0 if the item_count is greater than 0 then \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 with timeout of 300 seconds \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 tell application &#8220;Cyberduck&#8221; \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 set theBrowser to (make new browser) \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 set miniaturized of window 1 to true \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 tell (theBrowser) \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 set encoding to &#8220;UTF-8&#8221; \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 connect to theServer with protocol theProtocol as user theUser with initial folder theUploadFolder \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 repeat with theFile in added_items \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 upload item theFile \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 end repeat \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 disconnect \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 end tell \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 tell (theBrowser) to close \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 end tell \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 end timeout \u00a0\u00a0\u00a0 end if end adding folder items to<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>[Don&#8217;t know, if Windows users will have any use of this. Sorry.) I use this on a Mac OSX.4.11 installation, and it should work all the way up to OSX.8. The Cyberduck FTP upload AppleScript, which chrispie.com had modified, I have further modified and now very flattering call AutoUpload2FTPwCyberduck. This means it does not sync &hellip; <a href=\"https:\/\/krabat.menneske.dk\/kkblog\/2013\/01\/05\/auto-upload-to-ftp-folder-with-cyberduck\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Auto-Upload to FTP folder with Cyberduck&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2289],"tags":[257,2375,2373,2100,2370,2371,2372,2376,2374],"class_list":["post-14700","post","type-post","status-publish","format-standard","hentry","category-mac-osx","tag-apple","tag-automation","tag-ftp","tag-mac","tag-osx-4","tag-osx-5","tag-osx-6","tag-script","tag-upload"],"_links":{"self":[{"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/posts\/14700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/comments?post=14700"}],"version-history":[{"count":1,"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/posts\/14700\/revisions"}],"predecessor-version":[{"id":14701,"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/posts\/14700\/revisions\/14701"}],"wp:attachment":[{"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/media?parent=14700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/categories?post=14700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/krabat.menneske.dk\/kkblog\/wp-json\/wp\/v2\/tags?post=14700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}