rigoletto Posted May 15, 2005 Posted May 15, 2005 I wish to create a button that will automatically paste text (previously copied into the clipboard) into a field but which prompts me with an error message if the field in not empty ie so that I dont over write anything! Other wise if the file is empty then it will paste automatically thanks
MoonShadow Posted May 15, 2005 Posted May 15, 2005 If you don't want to allow a paste if the field contains data: If [ not IsEmpty(field) ] Halt Script End If Paste[No Style; field ] If you want to give the option to overwrite: If [ not IsEmpty(field) ] Show Custom Dialog( "Overwrite"; "Cancel"; "Field contains data. Replace with clipboard contents?" ] If [ Get(LastMessageChoice) = 2 ] Halt Script End If End If Paste [select; No style; field ] Paste can be problematic however. It's better to use Set Field [] or even script parameters. Otherwise, a User may find themselves pasting all kinds of junk into this field even if it's empty (like things previously copied onto clipboard from another app). You haven't said enough for me to describe how script parameter could be used and I am unsure when your copy process happens.
Recommended Posts
This topic is 7135 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now