Put a string into variable inputText via dialog display.
Then use a do shell script to call perl regex and check if inputText is characters only
If it is, display dialog OK. else NOT OK.
I have no idea how to use variable inputText in do shell script.
It depends. What you want to do after something happens. This one errors when a character is not an alphabet.
property a : "abcdefghijklmnopqrstuvwxyz"
--
display dialog "Enter whatever:" default answer "something"
set user_input to text returned of result
repeat with this_char in user_input
if (contents of this_char) is not in a then
beep 3
error "bad character"
end if
end repeat
Thanks for help
To tell the truth I want to check measurement units in InDesign.
I thought regex may help.
For example. I have display dialog and I can put there anything. I want check if it is millimeter or inch or point or pica point.
So I want to check this via regex and if there is a “mm” or " mm" or “in” or etc. then a script make a conversion to this unit.
I don’t know how to use my variable from AS in regex.
Oh, I see what you’re saying. You should use AppleScriptStudio. Getting user input takes a lot o work sometimes. Instead use the ui and you can restrict what type of data they enter.