• 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: Chris Waldrip <email@hidden>
  • Date: Tue, 04 May 2010 22:26:57 -0400

Still no luck, but a different error this time. The old favorite "Can't make alias <path-to-filename> into type unicode text. 

This modified script works/breaks just as the original. Open to select the file works. Drag to select the file doesn't.

I've tested with a different server and on a different machine as well.

I like Transmit, and the customers already have this bought and installed before I even called called upon for this. Groan. Maybe I'll start looking at using the command line. I wish the server in question was available via nfs or smb.

I do like the on run segment in your reply Ed. I haven't seen that before (and it's been dually noted in my scrapbook). And I'll be asking my boss to let me order ScriptDebugger first thing in the AM.

-Chris

On May 4, 2010, at 7:37 PM, Stockly, Ed wrote:


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: "Stockly, Ed" <email@hidden>
References: 
 >Re: Transmit 3 "on open" vs "choose file" problem (From: "Stockly, Ed" <email@hidden>)

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