Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Applescript: Scripting Vicomsoft FTP Client

Applescript: Scripting Vicomsoft FTP Client
Thread Tools
Fresh-Faced Recruit
Join Date: Jan 2005
Location: Madison, WI
Status: Offline
Reply With Quote
Jan 5, 2005, 12:36 PM
 
I'm looking for documentation or sample scripts for Vicomsoft FTP Client 4.0.4 on OS X 10.3.6. Vicomsoft Tech Support says the app is not scriptable even though it has a dictionary and I have gotten a couple of commands to work.

What I'm looking for is documentation or sample scripts that will help me nail down syntax. Basically, I want to open a connection, be able to change directories and upload files.

Thanks much,

Chuck
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Jan 5, 2005, 03:45 PM
 
why not simply "do shell script" and use the built in ftp command and the -u switch. Something like this:
Code:
do shell script "ftp -u ftp://passowrd:username@host/path/to/destination " & unixPathToFile
Of course this stores the password in the script (not generally a good thing), but since you are already using ftp, which is an in-secure method from the get go... (passwords in clear text over the network...)

Personally I would do it with scp and pre-shared ssh-keys... or maybe even the same trick with rsync (even better the rsync from RsyncX) to lower the bandwidth when I am replacing a file...
(Last edited by larkost; Jan 5, 2005 at 03:50 PM. )
     
Sholdt  (op)
Fresh-Faced Recruit
Join Date: Jan 2005
Location: Madison, WI
Status: Offline
Reply With Quote
Jan 5, 2005, 04:00 PM
 
I've actually built a handler using curl that I can use.I wanted a scriptable application that my staff could update and do on their own. They're a bright crew, but, for the most part, still on OS 9 (our servers or OS X.) The switch to OS X UNIX commands may be a bit more than they are ready for at this point.

on ftp_upload(remote_site, master_directory, client_directory, userName, userPasswd, file_date, upload_this, suffix)
set theFileIsOpen to false
set saveErrors to false
set myHandler to "ftp upload: "

try
set upload_this to upload_this as string
set myCommand to "cd " & (POSIX path of (master_directory & client_directory & ":" & client_directory)) & "_final_files" & "/;" & ¬
"curl --upload-file '" & (upload_this) & "' " & remote_site & client_directory & ¬
"/ --user " & userName & ":" & userPasswd & " " & " --quote -quit"
set foo to do shell script myCommand
return "OK"
on error errtext number errNum
set myerror to {errtext, errNum, myHandler}
tell me to handleErrors(myerror, saveErrors, theFileIsOpen, upload_this)
end try
end ftp_upload
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:26 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2