• 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: detect launch of file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: detect launch of file?


  • Subject: Re: detect launch of file?
  • From: Jolly Roger <email@hidden>
  • Date: Tue, 13 Mar 2001 12:45:42 -0600
  • Replyto: email@hidden

on 3/12/01 11:45 AM, Phil Calvert (email@hidden) wrote:

> Is there any way (via applescript) to detected the launch of a file? I want
> an applescript to do something only if a certain file type is launched.

Hi Phil,

In the future, it would help avoid confusion if you would use the correct
terminology. You don't "launch" files, you "open" them. Also, you should
refer to applications as "applications" or "application files", not "files".

If you just want to detect when a certain application launches, you will
need to monitor the running "processes", as Bryan <email@hidden> has
already shown:

on idle
tell application "Finder"
if name of processes contains "SimpleText" then
--do your stuff here
tell me to quit
end if
end tell
return 1
end idle

If you want to know when a particular "file" is open (not an application,
but a simple file), then that will be harder to accomplish. You *may* be
able to detect it by checking the opened state of the file periodically; but
I doubt that functionality exists in plain vanilla AppleScript; so you'll
probably need to use a scripting addition.

HTH

JR


  • Follow-Ups:
    • commands in a string..
      • From: "timmie..." <email@hidden>
    • Re: detect launch of file?
      • From: Dale Saukerson <email@hidden>
References: 
 >detect launch of file? (From: Phil Calvert <email@hidden>)

  • Prev by Date: Re: Quark - modify the master spread or screen?
  • Next by Date: OT: MacOS 'keeping' adobe from implementing Macros?
  • Previous by thread: Re: detect launch of file?
  • Next by thread: Re: detect launch of file?
  • Index(es):
    • Date
    • Thread