• 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: Why these errors?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why these errors?


  • Subject: Re: Why these errors?
  • From: 2551 <email@hidden>
  • Date: Sun, 09 Feb 2014 21:18:40 +0700

On 8 Feb 2014, at 08:56, Christian Boyce <email@hidden> wrote:

Easy stuff, and it works. But, if I leave off the "my" so that the calling line says…

convert_the_file(the_file)

I get an error:

error "Finder got an error: Can’t continue convert_the_file." number -1708

I think it always help with AppleScript to keep in mind “who” (i.e., what) you are addressing with your commands.

When you write ‘tell application “Finder” ’ remember that the verb “tell” is not being addressed to the Finder. It’s being addressed to the parent script object in which that tell block resides. It has the form “the parent script object should tell the application “Finder” to…"

The commands inside the tell block, however, are being addressed to the Finder directly. So the command 

convert_the_file(the_file)

is equivalent to 

tell application “Finder to tell its handler convert_the_file(the_file)

Finder responds with an error because it has no such function/handler. Inserting the ‘my’ redirects the command up to the parent script object, which of course does know about the function as that’s where you’ve declared it. i.e., 

tell application “Finder to tell my handler convert_the_file(the_file)"



Best

Phil

 _______________________________________________
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: Why these errors?
      • From: Christian Boyce <email@hidden>
    • Re: Why these errors?
      • From: Christopher Stone <email@hidden>
References: 
 >Why these errors? (From: Christian Boyce <email@hidden>)

  • Prev by Date: Re: running Applescript applications as alarms in Calendar on Mavericks
  • Next by Date: Re: Why these errors?
  • Previous by thread: Re: Why these errors?
  • Next by thread: Re: Why these errors?
  • Index(es):
    • Date
    • Thread