Re: [MacPerl-Toolbox] AppleEvents and GraphicConverter

[email protected] (Alan Fry) Wed, 5 Jun 2002 12:50:11 +0100
Newsgroups perl.macperl.toolbox
Message-ID <p05100300b923a830d5ef@[158.152.146.73]>
At 10:38 am +0200 03/06/02, Bart Lateur wrote:
>  >If 'GraphicConverter' is not running, then it is launched but the
>>'Hide' event fails:
>
>>Any ideas?
>
>My idea is that the Hide() instruction comes too early for Graphics
>Converter to receive it. It is probably not even fully started up yet.

Yes, that does indeed seem to be the problem.

At 5:21 pm -0400 03/06/02, Chris Nandor wrote:
>Here's something you can play with, sorta off the top of my head:
>
>	#!perl -w
>	use Mac::Glue ':all';
>
>	my $finder = new Mac::Glue 'Finder';
>	my $gcon = new Mac::Glue 'GraphicConverter';
>
>	# construct property object record only once
>	my $visible = $finder->prop(
>	   visible               =>
>	   application_process   =>
>	   $gcon->get( $gcon->prop('name') )
>	);
>
>	# keep setting to false, until it is false :-)
>	while ($finder->get( $visible )) {
>	   $finder->set($visible, to => gFalse);
>	}

Many thanks -- it's a nice idea. There is a snag in that you can't 
'get' the 'visible' of 'GraphicConverter' either until it has 'woken 
up', or so it seems.

But you can keep 'setting' the visibility to false until there is no 
AE error, which amounts to much the same thing and that works fine.

Alan Fry