if cancel end mouseup ?
Posted: Tue May 31, 2016 12:05 am
Scripting a button to ask for content in a textbutton, I find it hard to avoid execution of the further lines of the script, if user shall be able to escape.
The original script goes:
on mouseUp
ask"Give a short name to a new textbutton"
put it into knapnavn
clone button "prototext" of stack "Mindmapping"
set the visible of it to true
set the name of it to knapnavn
set the width of btn knapnavn to the formattedWidth of btn knapnavn
set the height of btn knapnavn to the formattedheight of btn knapnavn
set the loc of it to 997,14
set the textfont of it to "Arial"
end mouseUp
But if user regrets and clicks cancel, the cloning takes place and delivers a nameless button- So i need an if clause before the cloning . But failed to find the way to script it. Neither the info on ask or info on cancel in the LC library gives me a clue.
Hope for help
Kresten Bjerg
The original script goes:
on mouseUp
ask"Give a short name to a new textbutton"
put it into knapnavn
clone button "prototext" of stack "Mindmapping"
set the visible of it to true
set the name of it to knapnavn
set the width of btn knapnavn to the formattedWidth of btn knapnavn
set the height of btn knapnavn to the formattedheight of btn knapnavn
set the loc of it to 997,14
set the textfont of it to "Arial"
end mouseUp
But if user regrets and clicks cancel, the cloning takes place and delivers a nameless button- So i need an if clause before the cloning . But failed to find the way to script it. Neither the info on ask or info on cancel in the LC library gives me a clue.
Hope for help
Kresten Bjerg