The script running finding a path to itself
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