I’m using the following code to create a folder using a curl shell script called from an applescript, which works perfectly:
on createTheFolder(webFolderName)
do shell script "curl -Q 'MKD " & htmlPath & webFolderName & "' " & ftpInfo
end createTheFolder
where htmlPath is the path, webFolderName is the name for the new folder, and ftpInfo is the ftp login information in ftp://user:password@ftp.something.com:21 format.
I would like to check if the folder in webFolderName already exists before creating the folder though.
thanks - that worked for me. I put the command in a try statement which tests for that folder using the CWD command:
try
do shell script "curl 'CWD " & passwdFilePath & webFolderName & "' " & ftpInfo
do shell script "curl -Q 'MKD " & passwdFilePath & webFolderName & "' " & ftpInfo
on error
display dialog "There's a problem with the name you entered. Does that folder already exist online?" buttons "Ok" default button 1 with icon caution
end try