[Cyberduck-trac] [Cyberduck] #3705: Missing Applescript support
Cyberduck
trac at trac.cyberduck.ch
Thu Dec 3 00:14:19 CET 2009
#3705: Missing Applescript support
-----------------------------------+----------------------------------------
Reporter: menteinfinita@… | Owner: dkocher
Type: defect | Status: new
Priority: normal | Milestone: 3.4
Component: applescript | Version: 3.3b2
Severity: normal | Keywords: applescript
-----------------------------------+----------------------------------------
Comment(by menteinfinita@…):
hi milestone,
that's exactly what i did. Here a sample script:
{{{
--
-- spc upload
-- attach this script as a folder action to a folder. on dropping files to
that folder, it will upload the files to the specified server using scp
--
-- you need to be able to access the destination server with key
authorisation for this to work
--
-- if you don't have key authentication, you can set it up this way:
--
-- 1. generate your keys typing this command in terminal:
-- ssh-keygen -t rsa
--
-- 2. upload your public key to the destination server
-- cat ~/.ssh/id_rsa.pub | ssh USERNAME at SERVER 'cat >>
.ssh/authorized_keys'
--
-- 3. test the key authentication
-- ssh USERNAME at SERVER
-- => you shouldn't be prompted to enter your pw
--
-- written by fyysh
--
on adding folder items to this_folder after receiving added_items
set DestServer to "USERNAME at SERVER:PATH_ON_SERVER"
set GrowlTitle to "IMG Upload"
--clipboard stuff
--if u need the url or something like that of the file your
uploading uncomment this
--it will put somethink like http://yourdomain.com/bla/filename in
your clipboard.
--you'll need to uncomment the command for setting te clipboard to
this below
--make sure your url ends with / !
--set DESTINATION_WEB_URL to "http://yourdomain.com/bla/" as text
set theFileName to ""
set the item_count to the number of items in the added_items
if the item_count is greater than 0 then
--spc upload
repeat with aFile in added_items
tell application "Finder" to set theFileName to
aFile as text
set theFilePath to (POSIX path of aFile) as text
try
set FileN to name of (info for alias
theFileName)
do shell script "scp -c blowfish -C " &
quoted form of theFilePath & " " & DestServer
--uncomment this to get the url+filename
in your clipboard
--set the clipboard to
(DESTINATION_WEB_URL & FileN)
--uncomment this to be notified if the
upload was successfull
--display dialog "Upload of " & FileN & "
was successfull." buttons {"OK"} default button 1 giving up after 5
on error
display dialog "Upload of " & FileN & "
failed." buttons {"OK"} default button 1 with icon 0
end try
end repeat
end if
end adding folder items to
}}}
--
Ticket URL: <http://trac.cyberduck.ch/ticket/3705#comment:5>
Cyberduck <http://cyberduck.ch>
FTP, SFTP, WebDAV, Cloud Files and Amazon S3 Browser for Mac OS X.
More information about the Cyberduck-trac
mailing list