• 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
Lookup if an application by application file id is running and if it is running quit it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Lookup if an application by application file id is running and if it is running quit it


  • Subject: Lookup if an application by application file id is running and if it is running quit it
  • From: Bjorn Van Blanckenberg <email@hidden>
  • Date: Thu, 19 Sep 2002 13:48:39 +0200

I want to lookup if Quark by application file id is running and if it is
running quit it.

The script below always quits the Finder


property Quarkprogramfolder : ""

property QuarkApp : ""

tell application "Finder"
set pathName to container of (application file id "XPR3") as string
set savedDelim to text item delimiters of AppleScript
set text item delimiters of AppleScript to {":"}
set thePath to (reverse of rest of reverse of every text item ,
of pathName) as string
set text item delimiters of AppleScript to savedDelim
set Quarkprogramfolder to thePath

set the QuarkList to list folder Quarkprogramfolder without invisibles
repeat with i from 1 to the count of the QuarkList
if item i of the QuarkList contains "PassPort" then
set the QuarkApp to item i of the QuarkList
end if
end repeat


if exists process QuarkApp then
tell application QuarkApp
activate
quit
end tell
end tell

--
Oooo.
oooO ( )
( ) ) /
\ ( (_/
\_)


Thanks
Bjorn Van Blanckenberg
_______________________________________________
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: Lookup if an application...
      • From: John Delacour <email@hidden>
  • Prev by Date: Re: Tell print/close to the frontmost app
  • Next by Date: Re: Unicode to plain text
  • Previous by thread: Re: Tell print/close to the frontmost app
  • Next by thread: Re: Lookup if an application...
  • Index(es):
    • Date
    • Thread