Re: Safari scripting
Re: Safari scripting
- Subject: Re: Safari scripting
- From: Craig Williams <email@hidden>
- Date: Thu, 27 Aug 2009 08:50:02 -0600
From: Timofey Danshin
Hello. I want to create a button in Safari that would, when pressed, copy the text of the web-page open in Safari into a new Pages document tell application "Safari" set safari_text to (do _javascript_ "getSelection()" in document 1) end tell
if safari_text is "" then tell me to activate display dialog "There was nothing selected in Safari." & return & ¬ "Exiting script" buttons {"Ok"} default button 1 return end if
tell application "Pages" set body text of document 1 to safari_text end tell
hth,
Craig Williams |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden