• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Transmit 3 "on open" vs "choose file" problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transmit 3 "on open" vs "choose file" problem


  • Subject: Re: Transmit 3 "on open" vs "choose file" problem
  • From: "Stockly, Ed" <email@hidden>
  • Date: Tue, 4 May 2010 18:37:59 -0500
  • Acceptlanguage: en-US
  • Thread-topic: Transmit 3 "on open" vs "choose file" problem

Title: Re: Transmit 3 "on open" vs "choose file" problem

On 5/4/10 3:41 PM, "Chris Waldrip" <email@hidden> wrote:
If I use "choose file" to select the file, it works with no problems.

If I use "on open", like I'll need to with the Compressor output, it fails (AppleEvent handler failed) in attempting to upload the file. There's no other change in the script except on open/end open and set to choose file.


Hey  Chris,

I don’t think this is a transmit bug.  

Choose file returns a file reference as an alias.  The open command works with a list of file references,  if you drop a singe file you get a list of one file.

So, here’s a modified version of your script that should work.

When you’ve saved this version you can double-click it to get the choose file behavior and drop files on it  to get the ‘on open’ behavior.

As for replicating the apple event log in script editor at runtime, there’s no way to do that.  There is a way to send specific log commands to the console, but that’s not very satisfying.

Your best bet is to purchase ScriptDebugger.  With that you save your script as an applet with debugging, then when you use the applet the script opens in debugger and you get the apple event logging and, even better, all the debugging tools.

HTH,

ES
on run
   set fileToUpload to choose file
   open {fileToUpload}
end
run
on open fileList
   repeat with thisFile in fileList
       set fileInfo to info for theFile
       set theServerAddress to "my.server.com <http://my.server.com/> "
        
set
theUserName to "username"
        
set
thePassword to "password"
        
set
theDirectory to "/my/path/"
        
try
           tell
application "Transmit"
                
set
SuppressAppleScriptAlerts to true
               tell current session of document 1
                   connect to theServerAddress as user theUserName with password thePassword with initial path theDirectory
                   upload item theFile with resume mode replace
               end tell
           end tell
           
display dialog "Connected"
        
on error
           
display dialog "There was a problem"
        
end try
   end repeat
end
open


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Transmit 3 "on open" vs "choose file" problem
      • From: Chris Waldrip <email@hidden>
References: 
 >Transmit 3 "on open" vs "choose file" problem (From: Chris Waldrip <email@hidden>)

  • Prev by Date: Re: Sortin an alias list by path
  • Next by Date: Re: Rep: sort with do Shell script
  • Previous by thread: Transmit 3 "on open" vs "choose file" problem
  • Next by thread: Re: Transmit 3 "on open" vs "choose file" problem
  • Index(es):
    • Date
    • Thread