Think of something that you wish Authorware could do but it doesn't?  Let the our good friends at Macromedia know via the wishlist.

Please let us know if you find any of the materials on this site inappropriate or offensive. Please include the url and why the material should be reviewed.

Comments and questions about the site are also welcome. Please no Authorware questions, use the AWARE list.

Back

B5007 - How can I get text from the clipboard loaded into a variable?

by - Joseph Ganci


I am trying to allow an exrternal program to use an authorware function or in some way load a string into an authorware variable. Is it possible to get a string from the clipboaurd and stuff it in a variable?

This approach uses a fake text entry interaction, hidden off screen, to copy the contents of the clipboard into a variable. Note that all the options set in the text field button inside the Interaction icon.

The Calculation ornament contains the following script:

PressKey("F12")

The Interaction icon's text field is set to a size of 8 pixels by 8 pixels, and its location is set to -150, -150.  Of course, it doesn't matter what its size and location are, as long as it is hidden completely off the screen.  The Action key is set to F12, and the Ignore Null Entries checkbox is turned off.

The Calculation icon contains this script:

TextPaste()
myvar := EntryText

This pastes the contents of the clipboard into the hidden text entry field, then sets the contents of that field into a user variable called myvar.  That's all there is to it! The only reason to use the Display icon is if you wish to show the contents of myvar. Personally, I think this is a pretty cool option, because it's done completely within Authorware and doesn't use any external functions.

There are 0 reviews
Add your review
Back