On 2006-10-07, at 00:10:35, Takaaki Naganoya wrote:
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>
Naganoya-san,
Can you translate this?
set ptm to (path to me)
set main to (((path to resource "Scripts" in bundle ptm) as string) & "main.scpt")
set spath to POSIX path of main
tell application "System Events"
activate
display dialog spath with icon caution
end tell
Save that as a script bundle (ptm.scptd). Then call from Terminal like:
# osascript ptm.scptd