Re: osascript - path to me
Re: osascript - path to me
- Subject: Re: osascript - path to me
- From: Timothy Bates <email@hidden>
- Date: Sun, 19 May 2002 10:40:50 +1000
- .mxoez?+: O?W^h1]g}IB\WO2A=6#`2^rL?jAu,r8EcKz@UG.r.7[$&Ym;j8^Wp;/KAlcda MO/$} $"[ c?\#d@cuN
- 9+kli1>@: KaeEcbn$EIG)tY@^[7y`lyrI<4S(cnqzmTD&4<tTkuNR(4dweN}SUlDX/X^c>"
>
Subject: Re: osascript - path to me
>
> It would be so simple for Script Editor simply to provide what is
>
> universally requested: consistency in interpreting path to me, so that
>
> the path to the script is returned whether the script is run as an
>
> applet or inside script debugger.
>
What if it's run from the Script Menu, a toolbar menu, Cron, Youpi
>
key or by another application? What if the script is loaded into another
>
script? Then who is 'me'?
"me" has to be the same person all the time: it should always be the script.
The only thing "path to me" is ever used for is to find the path to the
script itself. No one ever Ever needs to know the path to Script Editor,
and if they did, they could ask the Finder. There is no other way except a
working path to me to find the path to an executing script.
>
So my grammatically correct question for you is 'Who do you think
>
'me' is'?
The script.
>
Time for some Ego spelunking!
I am not a psychoanalytical person, unfortunately, so you will have to go
there alone.
>
If you want the location of the source file then say so.
>
>
property mySourceCode : alias
>
"Dalai:Users:paulskin:Library:Scripts:Developmental:DEV Scripts:
>
Personal:GMT time string"
>
mySourceCode
>
-->alias "Dalai:Users:paulskin:Library:Scripts:Developmental:DEV
>
Scripts: Personal:GMT time string"
>
>
Still dynamically tracks the source code file as long as you don't
>
save your source out to a new file. And no mucking about with the way
>
'me' works!
This, like all other solutions to this problem is useless: apart from being
error prone, it breaks on any distribution of the script: it is useful only
for people who never use scripts elsewhere.
>
> There are no other (reliable and simple) ways for a script to find its
>
> resources. It is a basic need that should be met and for which
>
> thousands of users would be greatfull.
>
>
On Friday, May 17, 2002, at 09:01 PM, Christopher Nebel wrote:
>
>
> The meta-question here is "why does your script need to know where it
>
> is?" The typical answer to this is "so it can locate some related
>
> resources it needs", which leads to the counter-question "why aren't
>
> you using AppleScript Studio to create an application bundle?"
>
>
And On Friday, May 17, 2002, at 11:42 PM, Timothy Bates replied:
>
>
> A. Doesn't run on 80% of their client desktops
>
> B. Requires a developer package
>
> C. Is MUCH harder to use for a simple script
>
> D. Gives them zero benefit over script editor.
>
>
I'd question D in this case.
Gee: that only leaves A,B,C, and about 200 hundred others I could come up
with if had a spare half hour. The simplest answer to this debate would be
to count the number of Script Studio apps in existence (1000?) and compare
it to the number of AppleScripts likely written since ASS was released:
something like many hundreds of thousands, I would say.
>
But right now, I can't think of an instance where a compiled script file
>
could be executed without someone knowing it's path already.
I can give you thousands: Basically anytime someone runs a script file from
the scripts menu of a host. Oh you say, then you are in the scripts folder
of that app". Wrong. You can be in any one of an unknown number of unknown
sub folders to that folder. The user has not a clue, and neither could the
author whose script has just been downloaded from the internet. The one
"solution" you gave (to hard code an alias) fails in this (and all other)
distribution scenarios.
>
Caveat: Any resources you put in the same folder as the application
>
might have been deleted by the user, or the app could have been pulled
>
out of it's distribution folder and put on the desktop. Bundles solve
>
these problems.
This is an absolute non-starter: no one is adopting bundles or ASS to solve
simple day to day script problems.
>
In my opinion 'me' is just not the right way to ask for the
>
location of the source script file. So, my last comment is: Leave 'me'
>
alone!
You have, glaringly, not given a single use (real use) of path to me such
that you want it to behave as it currently does for a real purpose. That is,
describe why you want it to tell you where the script editor is if you arein
SE, where the script is if you are in Script Debugger, if it is running as
an applet, or if it is running from OSAmenu, or where an indeterminate
script runner is if it is running from the shell or something (g_d knows
that that would return)
>
On Saturday, May 18, 2002, at 04:25 AM, Christopher Nebel wrote:
>
>
> On Friday, May 17, 2002, at 08:42 PM, Timothy Bates wrote:
>
>
>
>> It would be so simple for Script Editor simply to provide what is
>
>> universally requested: consistency in interpreting path to me, so that
>
>> the path to the script is returned whether the script is run as an
>
>> applet or inside script debugger.
>
>>
>
>> There are no other (reliable and simple) ways for a script to find its
>
>> resources. It is a basic need that should be met and for which
>
>> thousands of users would be greatful.
>
>
>
> Would you care to write a bug on this? No one else ever has that I can
>
> find.
>
>
>
>
>
> --Chris Nebel
>
> AppleScript Engineering
>
--
>
Paul Skinner
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.