Page 1 of 2

To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 8:16 am
by Mag
...to get the current card I have to use...

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 11:17 am
by Klaus
Monsieur? :shock:

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 11:23 am
by Mag
:D :lol: :roll: :shock:

Maybe

Code: Select all

the current card name -- pseusocode

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 11:53 am
by Klaus
Maybe this:
...
put the short name of this cd of the defaultstack into tCurrentCard
...
?

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 1:31 pm
by Mag
Hi Klaus, thanks. The fact is that the code is on a card that is not in foreground :mrgreen:

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 1:48 pm
by Klaus
Mag wrote:Hi Klaus, thanks. The fact is that the code is on a card that is not in foreground :mrgreen:
The code? Soory, no idea what you try to achieve?

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 1:51 pm
by Mag
Hi Klaus,

I have a handler in a card where there is the need to know what is the current card displayed. And, no... the card displayed is not the one that contains the running code... :roll:

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 1:52 pm
by Klaus
Hm, if:
...
put the short name of this cd of the defaultstack into tCurrentCard
...
is not what you need, then I have still no idea!?

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 1:56 pm
by Mag
Hi Klaus, isn't "this card" used to refer to the card where the code is running? Actually I need to know the name of the card which is the current frontmost card. :oops: :cry:

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 1:59 pm
by Klaus
Mag wrote:Hi Klaus, isn't "this card" used to refer to the card where the code is running? Actually I need to know the name of the card which is the current frontmost card. :oops: :cry:
Ah, I think I get it...

But how do you call that namely script and what is in it?
Means, please post the code.

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 2:04 pm
by Mag
Hi Klaus, the code is called by a menu item, that menus are located in a different card. The code is simple, a thing like this one:
copy word -3 to -1 of field "output"

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 2:25 pm
by Klaus
Sorry, still no way!?

How can you select a menu item on card X, but exspect card Y to be the current card? :shock:

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 3:25 pm
by Mag
Because the menu is a pulldown menubar menu on OS X! :mrgreen:

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 3:29 pm
by Klaus
OK last try! :D

Does this do what you want:

Code: Select all

on menupick xyz
  ...
  set the defaultstack to the topstack

  ## COPY will only copy SELECTED text!
  set the clipboarddata["text"] to (word -3 to -1 of field "output")
...
?

Re: To get the topmost stack I have to use topStack...

Posted: Wed Jul 09, 2014 3:37 pm
by Mag
Thank you Klaus! I almost feel sorry that we have found a solution, it was fun! :D :lol: :mrgreen: :wink: :P