Object paths?

Brian Yennie briany at qldlearning.com
Wed Jul 21 01:54:57 EDT 2004


Troy,

I think what you really want is the long _name_ of the object.
Try putting this in a button (or better yet, a frontscript):

on mouseDown
   if (the controlKey is down) then
     set the clipboardData["text"] to the long name of me
   end if
   pass mouseDown
end mouseDown

You can adjust as necessary, but that will put a script useable path to 
the object on to the clipboard for pasting when you control-click on 
something.

HTH,
Brian

>
> On Jul 21, 2004, at 1:02 AM, Richard Gaskin wrote:
>
>> But I had thought that one of the parts of this thread noted that the 
>> long ID will include the path to the stack containing the object.  
>> This is no problem for an internally used stack that never moves, but 
>> should the path to the stack change the script will no longer work.
>
> Correct. That form is not directly usable.
>
>>
>> Perhaps better would be to find a more common and generalized 
>> solution for the problem at hand.  What is the problem at hand?
>
> Hmm. The problem is, that in certain project types, where the 
> defaultStack is not entirely usable, because there are various scripts 
> which can open stacks with no user interaction, through callbacks and 
> asynchronous events, the apparent best method is to use a more 
> explicit path to an object, to avoid "can't find..." errors. That can 
> add up to a lot of typing. I was somewhat surprised, that the 
> interface has no support to get the full path to an object into some 
> form which is easily inserted into a script. It seemed to me, that it 
> could be a context menu item.
>
> Sometimes, even if the path does not have to be overly explicit, I 
> think this would be helpful.
>
> e.g. button "myButton" of group "layer 1" of group "The big container 
> group"
>
> I don't even find anything which displays the path at all to such an 
> object. I would have though that the property inspector would, but it 
> doesn't. While the interface and the language support "infinitely" 
> nested groups, unless you have an exceptional memory, and strong 
> typing skills (I have neither) you don't really want to do it.
> --
> Troy
> RPSystems, Ltd.
> http://www.rpsystems.net
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>



More information about the use-livecode mailing list