Uploading a dropped file with Applescript and Transmit    

I get an NSInternalScriptError when I try to run the following code.
The code is supposed to upload a file or files that are dropped on the
script. Transmit is the program that should do the uploading.

I believe the line :

upload item some_items

is drawing the error. I think it has something to do with how the
path is created. I think the path that Transmit likes uses → ‘/’ as
delimiters and the variable is passing ‘:’ instead. I tried to change
but I’m not sure how.

code ===========

on open some_items – droplet handler
activate application “Transmit”
tell application “Transmit”
make new document at before front document

           -- send commands to the frontmost document window
           tell document 1

                   connect to "[url=ftp://ftp.mydomain.net]ftp.mydomain.net[/url]" as user "user" with password "pass"

with initial path “/public_html/” with connection type FTP using port
21

                   if (connect to "[url=ftp://ftp.timreynolds.net]ftp.timreynolds.net[/url]") then
                           try
                                   -- Setting the path to a complete specified path

if (set their stuff to “invoice”) then
– Uploading the file
upload item some_items

                                   end if
                           end try
                   else
                           display dialog ("An error occured, could not connect to ftp")
                   end if
           end tell
   end tell

end open

I don’t have a copy of transmit, so someone else will give you a better answer, but if some_items is a list, then you’ll want to use

repeat with the_item in some_items
upload the_item
end repeat

instead of "upload item some_items "

Tell us what your event log looks like when you run this from Script Editor if you have trouble. (Change the user name and password if they appear in the log output.)

The upload command takes a file or folder reference, so it doesn’t appear that you’ll need to change the path item’s class. But I’m just guessing since I don’t have transmit…

===> Dictionary…
upload: Upload a file or folder upload reference – the object for the command item Unicode text – The path of the file/folder you want to upload. Result: boolean – the reply for the command