Re: finding the name of the target's stack in a script

2012-07-25 Thread Peter Haworth
I'm guessing almost everyone on this list have their own routines to do this and it's interesting to see the different methods. Here's mine, with a getOwner thrown in for good measure. function getGroup pid if word 1 of the owner of pid is not "group" then return empty else retu

Re: finding the name of the target's stack in a script

2012-07-24 Thread Peter M. Brigham
On Jul 24, 2012, at 8:28 PM, Dr. Hawkins wrote: > It seems, though, that there should be a construct along the lines of > > the stack of > the card of > the group of I tried to find a way of doing this without "do" commands, but… function stackOf tObjLongID replace " of " with numtocha

Re: finding the name of the target's stack in a script

2012-07-24 Thread Dr. Hawkins
SO many choices . . . (and so many ways to blow my foot off, too :) It *should* only be called from actually clicking the button, which would make topstack make sene. It's a one line difference in a one-line handler . . . for one stack, a second routine needs to be called to immediately stash to

Re: finding the name of the target's stack in a script

2012-07-24 Thread Dar Scott
On Jul 24, 2012, at 9:52 AM, Richard Gaskin wrote: > Parsing the executionContexts may help, but if the button must be manually > clicked it may be simpler to use the mouseStack function. Thank you for your reminders of how bountiful the command and function set is. I had forgotten about mouse

Re: finding the name of the target's stack in a script

2012-07-24 Thread Peter M. Brigham
On Jul 24, 2012, at 12:22 PM, Ben Rubinstein wrote: > On 24.07.2012, at 17:33, Dr. Hawkins wrote: > > I have a handler that needs to handle an event differently depending > > upon which substack the button calling it is on. > > You could use "the owner" to walk up the heirarchy from the target -

Re: finding the name of the target's stack in a script

2012-07-24 Thread Mark Wieder
Doc- Tuesday, July 24, 2012, 8:33:52 AM, you wrote: > I have a handler that needs to handle an event differently depending > upon which substack the button calling it is on. Does the long name of the target give you what you need? If you know the handler will *only* be invoked from substacks, no

Re: finding the name of the target's stack in a script

2012-07-24 Thread Ben Rubinstein
On 24.07.2012, at 17:33, Dr. Hawkins wrote: > I have a handler that needs to handle an event differently depending > upon which substack the button calling it is on. You could use "the owner" to walk up the heirarchy from the target - eg create a function "owningStack" which successively gets th

Re: finding the name of the target's stack in a script

2012-07-24 Thread Peter Haworth
You could pass the stack name in to the handler as a parameter. Pete lcSQL Software On Tue, Jul 24, 2012 at 8:33 AM, Dr. Hawkins wrote: > I have a handler that needs to handle an event differently depending > upon which substack the button calling it is on. > > I don't s

Re: finding the name of the target's stack in a script

2012-07-24 Thread Björnke von Gierke
word 8 of the long id is not reckless, it's just not going to work every time, because of substacks, and such. for example this is a valid long id for a stack: stack "/Drive/Folder/Stack. rev" and this too, if it's an unsaved substack: stack "Untitled 2" of stack "Untitled 1" There's also "the ow

Re: finding the name of the target's stack in a script

2012-07-24 Thread Richard Gaskin
Dr. Hawkins wrote: I have a handler that needs to handle an event differently depending upon which substack the button calling it is on. I don't see a direct way of referencing the calling stack. There is the topStack() function, which would *seem* to necessarily return the relevant stack, but

finding the name of the target's stack in a script

2012-07-24 Thread Dr. Hawkins
I have a handler that needs to handle an event differently depending upon which substack the button calling it is on. I don't see a direct way of referencing the calling stack. There is the topStack() function, which would *seem* to necessarily return the relevant stack, but something makes me ne