Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search clipboard 1

Status
Not open for further replies.

PhilBreau

Technical User
Dec 14, 2001
108
CA
Is there a command that can search for a string in the clipboard?

Thank you
 
There are no commands that I am aware of to search the clipboard, but you could copy the contents of the clipboard to a string using the cliptostr command (only up to 256 characters will be copied since that is the size of a string in ASPECT), then use strfind to search that string for the text you are looking for.


aspect@aspectscripting.com
 
Thank you for your reply, Knob. cliptostr/strfind will work great if the target is within the 256 character limit. Any suggestions if the target is beyond 256?
 
The only workaround in that case would be to use cliptofile to save the clipboard to a file, then open that file in your script and search through it line by line using strfind. The only potential problem you could run into there would be if the file was larger than 256 bytes, that the string you are searching for could be split across two different strings read from the file. If the text on the clipboard has lines of less than 256 characters (i.e. formatted to say 80 columns like most documents), then this should not be an issue.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top