Go Back   The macosxhints Forums > Working with OS X > OS X Developer



Reply
 
Thread Tools Rate Thread Display Modes
Old 07-17-2008, 05:13 PM   #1
cdoyle1966
Registered User
 
Join Date: Jul 2008
Posts: 1
AppleScript FTP putting files

I am new to Mac and AppleScript. Trying to figure out how to replicate a PC batch file.

Batch file changes directory, issues ftp command that pulls in a .txt file with the ftp commands. The .txt file logs in, changes to correct directory and uses "put" command to load the file.

Batch file:
cd\webspecial
ftp -s:runspecial.txt
exit

runspecial.txt file:
open www.starmarketandcatering.com
username
password
cd web
put c:\webspecial\specials.shtml
quit

Trying to replicate this with AppleScript. Any help is greatly appreciated.
cdoyle1966 is offline   Reply With Quote
Old 07-17-2008, 05:44 PM   #2
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 32,459
I'd look more to a shell script than to AppleScript. AppleScript's strength is interacting with GUI apps which you don't seem to be doing here.

Look also at the 'expect' command: read 'man expect'
__________________
hayne.net/macosx.html
hayne is offline   Reply With Quote
Old 07-17-2008, 08:26 PM   #3
baf
MVP
 
Join Date: Jun 2007
Location: Skellefteċ, Sweden
Posts: 1,173
Code:
#! /bin/bash
curl -T /some/where/specials.shtml -u username:password \
ftp://www.starmarketandcatering.com/web/
__________________
/Bengt-Arne Fjellner IT-Administrator Luleċ university, Sweden.
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
baf is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting 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

Forum Jump



All times are GMT -5. The time now is 07:46 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.