develooper Front page | perl.macperl.toolbox | Postings from June 2002

Re: [MacPerl-Toolbox] AppleEvents and GraphicConverter

From:
Chris Nandor
Date:
June 3, 2002 14:21
Subject:
Re: [MacPerl-Toolbox] AppleEvents and GraphicConverter
Message ID:
p05100320b9218e06a38c@[10.0.1.177]
At 10:38 +0200 2002.06.03, Bart Lateur wrote:
>On Sun, 2 Jun 2002 14:23:16 +0100, Alan Fry wrote:
>
>>However there is a glitch. Running this script:
>>
>>	if (!IsRunning('GKON')) { LaunchApps('GKON')}
>>	Hide('GKON');
>>
>>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.

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);
	}

-- 
Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About