• 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: Shane Stanley <email@hidden>
  • Date: Sat, 08 Feb 2014 13:18:30 +1100

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

> When did "my" become the key for a handler like this?

Some time in 1993, would be my guess.

> And what's the point of requiring it? It's not as if there is some other "convert_the_file" handler that the script might get confused about-- or is there?

But there's no way of knowing it's a call to a handler. As far as AppleScript is concerned, you've used a term inside an application tell block, and it has looked inside that application's dictionary and found no such term. The "my" essentially tells it to look beyond the application.

> I have a second question. If the display dialog line doesn't have the "as string" at the end, I get this error:

You're passing a Finder item to the handler, but you're not addressing the Finder in your handler, so it isn't going to work. It only compiles like that because "name" is a reserved AppleScript term. Use:

on convert_the_file(some_file)
	tell application "Finder"
		-- do stuff with some_file)
	end tell
end convert_the_file

--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>


 _______________________________________________
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


References: 
 >Why these errors? (From: Christian Boyce <email@hidden>)

  • Prev by Date: Why these errors?
  • Next by Date: " Display Dialog " without stopping script execution
  • Previous by thread: Why these errors?
  • Next by thread: Re: Why these errors?
  • Index(es):
    • Date
    • Thread