January 21, 201214 yr I've been trying for 3 days to figure out the syntax for an FTP Upload custom function (downloaded from briandunning.com), but I can't get it to work. It always fails with error -2740, "an unknown token can't go here," which tells me nothing. Anyone care to check out my script and offer some pointers? I'm sure there's a syntax error, but I can't find it. I want to hard-code the username and password, but the password contains special characters (parentheses), and I'm not sure how to escape them: i,e, ythr(i.K9)56 I've tried various escaping approaches: ythr(i.K9)56 , "ythr" & "(" & "i.K9" & ")" & "56", etc. FTPUpload (path, directory, file) " set thePath to quoted form of "ftp://<username>:<password>@ftp.remotehost.com/targetfolder/" do shell script "curl -T" path & "/" & directory & "/" & file thePath " Any ideas?
January 21, 201214 yr Do you have a working AppleScript? That is one that works when run from AppleScript Editor? --- P.S. Could I please ask you to change your avatar? It's very distracting.
January 21, 201214 yr Author Haven't posted in a while, so the first thing I thought was "I wonder how many people are going to post to ask me to change my avatar? Actually, the entire script step is Perform Applescript (calculated) FTPUpload($path, $directory, $file) where $path, $directory and $file are local variables
January 21, 201214 yr I suggest you step away from the custom function and do some experimenting in AppleScript Editor or directly in the terminal until you find out what kind of escaping is necessary and acceptable in cURL. Until then, this is not a Filemaker or even AppleScript issue. I suspect that as long as your password doesn't contain quotes, colons or at signs, it shouldn't need any escaping. But that's merely a guess. Edited January 21, 201214 yr by comment
January 22, 201214 yr I wonder how many people are going to post to ask me to change my avatar I had the same concern as you, and was waiting to see if anyone actually did reply, as I tagged your post for follow-up in case no one did, and to see what others had to say about it. Personally I couldn't concentrate on your question with your avatar on-screen, maybe others had the same problem. I'm curious as to why you would use it when you, yourself, thought it was over the top? Lee
January 24, 201214 yr Newbies Just use a simple shell script, see the code below: Enjoy! ----------------- #!/bin/sh ftpserver="ftp.server.com" remotepath="Import" ftplogin="myuserid" ftppass="mypass" function ftpfile { ftp -n $ftpserver <<INPUT_END quote user $ftplogin quote pass $ftppass cd $remotepath prompt off mput TheFile2BUploaded.csv exit INPUT_END } ftpfile exit ---------
Create an account or sign in to comment