LengthLimit in fld when pasting
Posted: Wed Jan 05, 2011 12:38 pm
Hi All,
This script limit the num of chars in a fld when the user paste a text in the field
Meaby you have a more simple way
Best
Jean-Marc
This script limit the num of chars in a fld when the user paste a text in the field
Meaby you have a more simple way
Code: Select all
on commandKeyDown pKey
if pKey is "V" then
put the clipboardData["text"] into MonCB
put the length of MonCB into NbCCB
put the selectedchunk into bufCC
put the value of word 2 of bufCC into depC
put the value of word 4 of bufCC into FinC
put last word of bufCC into LeFld
if depC > FinC then
put the length of fld LeFld into NbCfld
else
put FinC-depC+1 into NbCfld
end if
put NbCCB+NbCfld into NbCharsTot
put NbCharsTot
if NbCharsTot > 10 then
beep
else
pass commandKeyDown
end if
else
pass commandKeyDown
end if
end commandKeyDown
Jean-Marc