[futurebasic] Re: [FB] FB/AS application launch

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2005 : Group Archive : Group : All Groups

From: Bernie <fblist@...>
Date: Thu, 8 Sep 2005 22:20:55 +0100
Steve wrote:

> i launch an external application, via AS and never have this problem.
> but I just tell the Application not System Events.
>
> have you tried it without that?


Yes. Here's how it was originally. I added the other lines in an  
attempt to solve the problem:

route _toAppleScript
print "tell application ""iTunes"""
print "set t to current track"
print "set message to t's name & ""\t"" & t's artist & ""\t"" & t's  
album"
print "end tell"
route _toScreen

Trouble is:
1) I don't know a lot about AppleScript.
2) My app calls the above every er... hm... I'm not sure how many  
nanosecond and as soon as I quit iTunes, it gets launched again.


Thanks
Bernie



> On Sep 8, 2005, at 3:31 PM, Bernie wrote:
>
>>
>> I'm using an old laptop to play music through my stereo system and  
>> I've adapted RP's "MovingEyes" demo to display the current iTunes  
>> track in large text across the screen. Trouble is, if I quit  
>> iTunes while my app is running, iTunes is immediately launched again.
>>
>> Here's the AS bit of my FB code which is called from a timer  
>> function:
>>
>> '----------
>> route _toAppleScript
>> print "tell application ""System Events""
>> print "if exists process ""iTunes"" then"
>> print "tell application ""iTunes"""
>> print "set t to current track"
>> print "set message to t's name & ""\t"" & t's artist & ""\t"" &  
>> t's album"
>> print "end tell"
>> print "end if"
>> print "end tell"
>> route _toScreen
>> '----------
>>
>> Any suggestions how I can prevent my app launching iTunes if it's  
>> not already running?
>>
>> Bernie
>>
>> --
>>
>>
>>
>
> --
>
>