Jump to content

copy from webviewer


This topic is 5430 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a layout with a webviewer and I want users to be able to highlight text within the webviewer which is copied to the clipboard by a script.

The first line of the script is "Copy[]"

This works fine if the script is run from the scripts menu.

I would ideally like the script to be triggered from pressing a button, however when the button is pressed, the webviewer is no longer selected and the highlighted text is lost.

I'm not sure if the button method is possible but thought it would be worth an ask!

ANy help hugely welcome.....

Link to comment
Share on other sites

In order to script this with a button you would need to...

GetLayoutObjectAttribute ( "webviewername" ; "source" )

...and use a calulation to extract the desired text from the HTML.

For some websites this is easy, others are next to impossible. (Remember this method can be broken by changes to the website.)

If you do a search on the forums on "scraping web pages" you will find a few examples.

Link to comment
Share on other sites

I agree that you would need those functions to scrape out the text from a web page, but the query was:

I want users to be able to highlight text within the webviewer which is copied to the clipboard by a script

which suggests that the required text is being highlighted manually by the user.

I think we need some feedback on what exactly is required.

Link to comment
Share on other sites

I'm not sure if the button method is possible but thought it would be worth an ask!

Insert a GoToObject[ObjectName: ] immediately before the Copy[]. Any highlighted text within the web viewer will then be copied to the clipboard.

Link to comment
Share on other sites

... and with a

Paste [ Select ; YourField ]

you'll have the selected text pasted into YourField.

BTW: any text selection can be dragged from the WebViewer and dropped into the field.

Link to comment
Share on other sites

This topic is 5430 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.