Whether the value is found on the clipboard or has to be entered, how would you reference that variable outside the if else? I'm wanting to insert this value into a specific cell on a spreadsheet.
My current script:
Code: Select all
if (regexmatch(clipboard, "\d{9}"))
{
SSN := clipboard
MsgBox % SSN
}
else
{
Menu, tray, Icon , search.ico, 1, 1
gui, destroy
Gui, +AlwaysOnTop
Gui, Add, Text,, Enter SSN:
Gui, Add, Edit, vSSN ym
Gui, Add, Button, x65 y40 w35 h20 +default, OK
Gui, Add, Button, x115 y40 w35 h20, Close
Gui, Show,, SSN
return
GuiClose:
ButtonClose:
ExitApp
ButtonOK:
Gui, Submit
MsgBox % SSN
return
}