Re: Applescript equivalent of $0 in shell script
Re: Applescript equivalent of $0 in shell script
- Subject: Re: Applescript equivalent of $0 in shell script
- From: Takaaki Naganoya <email@hidden>
- Date: Sat, 7 Oct 2006 16:10:35 +0900
I can't understand about your whole program.
But you have some another option to aquire the name of script.
If you saved the script as application, you can the name of itself by
using "name of me".
If you run script from Terminal.app and Script Menu, you can not get
the name of script itself.
But if select script file within Finder's window, you can get the
name of the file by "name of selection" like this...
<AppleScript>
tell application "Finder"
set a to selection
set b to item 1 of a
end tell
set c to b as alias
tell application "Finder"
set d to name of c
end tell
</AppleScript>
<English>
If you write to me in Japanese, I can give some suggestion,
But I'm not good speaker in English. Sorry.
</English>
<Japanese>
日本語であれば、詳細についてお話することは可能ですが、
私自身英語は堪能でないためこの程度でご容赦いただきたく。
</Japanese>
--
Takaaki Naganoya
Piyomaru Software
http://piyo.piyocast.com
email@hidden
On 2006/10/07, at 13:11, Hiroshi T. wrote:
Could someone kindly tell me how to obtain the file name of the
script itself?
I'm thinking of making a symbolic link to the script file and
implement slightly
different functions in one script as one can do for shell script.
I tried
get name of document 1
While this line works when invoked in the Script Editor, it does
not work when invoked from Finder.
Thanks for reading.
---
H.T.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (Applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
mark.nu
This email sent to email@hidden
_______________________________________________
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