Re: Prevent application launching?
Re: Prevent application launching?
- Subject: Re: Prevent application launching?
- From: Mr Tea <email@hidden>
- Date: Tue, 26 Mar 2002 22:58:30 +0000
This from Brad Knabel - dated 26/3/02 10:29 pm:
>
Is there a way to either:
>
1. Prevent an Applescript from launching an application if it's not running?
>
or
>
2. Determine the frontmost application from within an AppleScript?
Ooh! Ooh! I know this one!
tell application "Finder"
set appList to name of every application process
end tell
This will return a list of running applications. Once you've got that, wrap
your script that communicates with BBEdit in an 'if' block like this:
if "BBEdit" is in appList then
[your script]
end if
Warning: The above example could run into problems if the name of the
Application has been changed. You could get round that by asking instead for
'creator type of every application process' and checking whether or not
BBEdit's 4 character creator type code is in the list.
Cordially
Mr Tea
--
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.