Re: running script get name of itself?
Re: running script get name of itself?
- Subject: Re: running script get name of itself?
- From: cris <email@hidden>
- Date: Wed, 27 Dec 2000 00:16:34 +0100
on 26.12.2000 23:00 Uhr, Bill Tandy at email@hidden wrote:
>
How can a running script get the name of itself as text (set myName to
>
...)?
-- without Finder:
name of (info for (path to me))
-- or:
set tempString to (path to me) as string
repeat while tempString contains ":"
set theOffset to (offset of ":" in tempString) + 1
set tempString to (characters theOffset thru -1 of tempString) as
string
end repeat
tempString
-- with Finder:
(name of file (path to me)) of application "Finder"
-- or:
tell application "Finder" to set AppName to name of application file
(path to current application)
Watch for linebreaks.
Greetings
cris :-)
--
English is my second language.
www.cooc.de