Re: Very Irritating Open Handler
Re: Very Irritating Open Handler
- Subject: Re: Very Irritating Open Handler
- From: Tommy Bollman <email@hidden>
- Date: Fri, 01 Apr 2011 20:49:18 +0200
Hello Luther
I tested it, it appears that the error is handled in the open handler. I'm sorry.
But the principles still work described in the book still works if you adapt it to your
open handler. Reading it (again), i see that I missed a couple of points.
What Matt Neuberg discusses is about error number -128, and is just valid for that.
It is on page 434 and can be found on Google Books, and is something you should absolutely
know about anyway, believe me, that is a good read!
You really need some code like this; and this is conceptual, which should overcoming the
problem of a "dying open handler". ( The error isn't propagating over to the Run handler.)
global shouldcleanup
on open
global shouldcleanup
repeat while true
try
if shouldcleanup is missing value then set shouldcleanup to false
if shouldcleanup is true then
--clean it up and recap
set shouldcleanup to false
end if
-- your error generating code here
-- do something with an aliaslist element here.
on error
set didcleanup to true
end try
if notMoreToProcess is true then
-- youve dunnit
tell me to quit
end if
end try
end open
on quit
continue quit
end quit
Den 1. apr. 2011 kl. 17.58 skrev Luther Fuller:
> On Mar 31, 2011, at 7:01 PM, Tommy Bollman wrote:
>
>> What is going on is way more complex than you think. You have to find the part of Matt Neubergs book "AppleScript the Definitive Guide" where Berkowitz is referenced, it is around a discussion of the open and run handler. Berkowitz nailed it.
>
> Unfortunately, I don't have that reference.
>
>> You see, the error statement triggers the run handler ... So you are really jumping into the run handler in the middle of your open handler.
>
> I've tried, but I can't get that to happen. Do you have an example script?
>
>> I guess something similiar will happne if you can't open a webloc file with the open handler.
>> Control is passed over to the run handler/implicit runhandler, and nothing more happens if you havent taken the measures described in Matt Neuburgs book.
>
> The list passed to the open handler is a list of class 'bmrk'. I've just tried searching for 'bmrk' at http://developer.apple.com/search/, but found absolutely nothing. Does anyone know of any documentation on 'bmrk'?
>
> _______________________________________________
> 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
>
Best regards
Tommy Bollman
--------------------------------------------------------------------------------------------------
Mollison's Bureaucracy Hypothesis:
If an idea can survive a bureaucratic review
and be implemented it wasn't worth doing.
_______________________________________________
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