Page 1 of 1
change name of card with script
Posted: Thu Aug 22, 2013 1:22 pm
by pascalh4
Hello everyone.
I am a beginner and I gradually discovers the software.
I found the explanation for changing the name of a stack with a script and it works perfectly:
Code: Select all
set the name of stack "oldname" to "newname"
But when I use the same script for a card:
Code: Select all
set the name of card "oldname" to "newname"
the following error message appears:
button "Button": execution error at line 5 (Chunk: can not find card), char 18
Note: I have checked the spelling of the name of the card.
Could someone tell me what is my mistake?
Thank you!
Pascal.
Re: change name of card with script
Posted: Thu Aug 22, 2013 1:33 pm
by Klaus
Hi Pascal,
1. welcome to the forum!
2. The syntax is correct and does indded work here in my little test!?'
Is that card in the same stack as that script?
Sure you did not rename that card earlier?
You can always check:
...
if there is a cd "oldname" then...
...
Best
Klaus
Re: change name of card with script
Posted: Thu Aug 22, 2013 2:43 pm
by pascalh4
Hi Klaus!
Thank you for the quick response.
The card has been renamed before my test, and no, my script is not in the same stack as the card.
Should I create a direction of "go to" type, or is there another method?
Note: The stack whose name changes is nor the same.
detail from my script.
Code: Select all
on mouseUp
copy stack "modèle" -- copy of the substack "modèle" of the stack "lancement"
paste --create a stack with new name "copy of modèle"
set the name of stack "copy of modèle" to "nouveau titre" -- change the old name with the new
set the name of card "cartemod" to "titre modifié"-- problem line
close stack "lancement" -- to clear the stack and its substack
delete stack "lancement" -- to remove this stack of the project browser
end mouseUp
Pascal
Re: change name of card with script
Posted: Thu Aug 22, 2013 2:59 pm
by Klaus
Bonjour Pascal,
pascalh4 wrote:..and no, my script is not in the same stack as the card.
Aha, then just add a correct "descriptor" and it should work:
...
set the name of cd "oldname" OF STACK "name of stack with the card here..." to "newname"
...
pascalh4 wrote:Should I create a direction of "go to" type, or is there another method?
Sorry, no capisce!?
But see above that should do the trick!
Best
Klaus
Re: change name of card with script
Posted: Thu Aug 22, 2013 3:00 pm
by pascalh4
In fact everything is working by adding these two lines (in bold)
copy stack "modèle"
paste
set the name of stack "copy of modèle" to "nouveau titre"
go to the stack "nouveau titre"
go to the card "cartemod"
set the name of card "cartemod" to "titre modifié"
close stack "lancement"
delete stack "lancement"
But is there a different or faster method?
Pascal
Re: change name of card with script
Posted: Thu Aug 22, 2013 3:34 pm
by Klaus
Hi Pascal,
OK, but 2 hints:
1. do not use:
go to
THE card...
-> go to cd xyz
or
go to
THE stack...
-> go to stack zyx
The keyword THE is for custom properties.
2. As I wrote in my first post, no need to GO to the stack and/or the card!
Just add a precise description of the card and you are done:
...
set the name of card "cartemod"
OF STACK "nouveau titre" to "titre modifié"
## Cleanest and fastest solution

...
Best
Klaus
Re: change name of card with script
Posted: Thu Aug 22, 2013 3:48 pm
by pascalh4
Klaus thank you very much for that.
I will do tests and I will continue my discovery.
I also want to ask a more general question about the topics. Where can I find an explanation of the icons of the questions (that means the little star, for example)
and how it should end this discussion.
Pascal
Re: change name of card with script
Posted: Thu Aug 22, 2013 3:54 pm
by Klaus
Sorry, don't understand "an explanation of the icons of the questions..."?
Re: change name of card with script
Posted: Thu Aug 22, 2013 7:06 pm
by pascalh4
Sorry for my bad English spoken (thank's google translate

).
I would like to know the meaning of the icons to the left of the topic discussed. (especially the star)
I tried to attach a photo, but I'm not happened.
I get this message: "Your account does not have permission to post links or domain/page references".
good evening
Pascal
Re: change name of card with script
Posted: Thu Aug 22, 2013 7:19 pm
by Klaus
Bonsoir Pascal,
ny french is even worse!
OK, sorry, I have no idea what these icons mean
And you need to have > X (10? Sorry, also no idea...) postings
before you are allowed to post links and attachments.
Best
Klaus
Re: change name of card with script
Posted: Thu Aug 22, 2013 7:59 pm
by pascalh4
Guten Abend Klaus.
Thank you for everything. I have another request to make, but I'll make another topic tomorrow.
Pascal