• 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
The script running finding a path to itself
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The script running finding a path to itself


  • Subject: The script running finding a path to itself
  • From: Brett Conlon <email@hidden>
  • Date: Thu, 17 Nov 2005 11:41:30 +1000


Hi all,

As part of a "version checking" handler in my PShop script I have it search the server for a newer version (by name only). If the name is different (eg from "XYZ 1.0" to "XYZ 2.0") it assumes it is upgraded and will then search for itself on the desktop (by part name "XYZ") and then moves itself to the trash and copies the newer version to their desktop. This is all working AOK thus far. However, I'd like to improve it.

1) I'd love to change the checking part to date modified, rather than just looking for a name change. ie: If modified date of version on the server is newer, then do all the replace stuff, else keep going.

2) Some designers have copied the script to their work drive (separate partition) so locating itself on the desktop won't work in that instance.

Is there a way to set a value to get the path to itself? This will help with both getting the modified date of itself and its location to move it to the trash, if need be.

I had a play with the following code but it only returns the Script editor app (which is me... not the script). Is there another reference for "me" to mean the script running?

set ScriptPath to alias (path to me as text)
tell application "Finder"
        activate
        display dialog ("This is ME: " & ScriptPath)
end tell

Your assistance will be greeted with much enthusiasm!  ;-D

Cojcolds
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: The script running finding a path to itself
      • From: kai <email@hidden>
    • Re: The script running finding a path to itself
      • From: Michael Henley <email@hidden>
  • Prev by Date: Re: arrange icons on desktop
  • Next by Date: Re: The script running finding a path to itself
  • Previous by thread: localization of ICAS daygroup constants
  • Next by thread: Re: The script running finding a path to itself
  • Index(es):
    • Date
    • Thread