Hi…
I need to edit a script i have done a few years ago, but i have lost the original script file and i cannot edit teh application…
When i need to redo is… limiting the number of charactere form a dialog return… I want to limits it to 5 letters. My original script contains a loop were if the user enter more than 5 characteres, the script bring back the dialog with his original text entered and in the text of the dialog show how many charactere need to be removed… Unfortunatly, i only do some basics scripting and the last times i really play with that was more than a yeasr ago… so i forget everything i learn at that times…
If anyone can share some light on my need i’ll appreciate…
Thanks Jean-Claude
: Hi…
: I need to edit a script i have done a few years ago, but i have
: lost the original script file and i cannot edit teh
: application…
: When i need to redo is… limiting the number of charactere form a
: dialog return… I want to limits it to 5 letters. My original
: script contains a loop were if the user enter more than 5
: characteres, the script bring back the dialog with his
: original text entered and in the text of the dialog show how
: many charactere need to be removed… Unfortunatly, i only do
: some basics scripting and the last times i really play with
: that was more than a yeasr ago… so i forget everything i
: learn at that times…
: If anyone can share some light on my need i’ll appreciate…
Something like this might work:
set dialogResult to display dialog "Enter no more than 5 characters." default answer ""
repeat until (count of characters of (text returned of dialogResult)) is less than 6
set dialogResult to display dialog "Enter no more than 5 characters. ¬
You entered:" default answer (text returned of dialogResult)
end repeat
Later,
Rob J
This is exactly what i was looking for… I change a few bit to suite my need and it is working…
Thanks so much!
jc
: Something like this might work:
:
: set dialogResult to display dialog “Enter no more than 5 characters.” default answer “”
: repeat until (count of characters of (text returned of dialogResult)) is less than 6
: set dialogResult to display dialog “Enter no more than 5 characters. ¬
: You entered:” default answer (text returned of dialogResult)
: end repeat