• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Prevent application launching?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Prevent application launching?
      • From: Mr Tea <email@hidden>
  • Prev by Date: Text Pictures [was : Re: Decomposing a B&W...]
  • Next by Date: Re: Decomposing a B&W bitmap graphic (or ideally, a font bitmap)
  • Previous by thread: Re: Prevent application launching?
  • Next by thread: Re: Prevent application launching?
  • Index(es):
    • Date
    • Thread