Your best friend for file transfer.

mkdir, passive mode and scripting (2 posts)
- Started 7 years ago by JImBrandt
- Latest reply 7 years ago from Jim Matthews
-
JImBrandt Member
-
Jim Matthews Administrator
Hi,
1) To detect the existence of a remote folder you'd do something like this:
tell application "Fetch"
open url "ftp://username:@hostname/path/"
set folderExists to exists remote folder "foobar" of transfer window 1
end tell2) To make a new folder you'd do something like this:
tell application "Fetch"
open url "ftp://username:@hostname/path/"
make new remote folder at beginning of transfer window 1 with properties {name:"foobar"}
end tell3) To force passive mode:
tell application "Fetch"
set use passive mode to true
end tellIn general, if you want to know how to do something in AppleScript, click the Record button in Script Editor and then perform the action manually in Fetch. Script Editor will write a bit of AppleScript code for you.
Thanks,
Jim Matthews
Fetch Softworks
- Page 1
Jim,
I have three questions (I need to do all of these from an Applescript):
1) How do I detect the existence of a folder on a remote location?
2) How do I use MKDIR to create a new folder?
3) Is there a way to force passive mode for a connection in a script?
Are there examples of these?
Number 3) is because I have a site that needs passive mode, but about one third of the time, times out getting the file list because of the active/passive settings. I'd like to connect to this site in passive mode in order to avoid the timeout.
Jim Brandt
Posted 7 years ago #