Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

copy from webviewer

Featured Replies

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.....

Since you just want to allow users to copy to the clipboard, can't you just get them to highlight the text then use 'Copy' from the Edit menu, or Apple-C?

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.

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.

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.

... 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.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.