Re: saving displayed text on a web page as rtf
Re: saving displayed text on a web page as rtf
- Subject: Re: saving displayed text on a web page as rtf
- From: Lists <email@hidden>
- Date: Fri, 05 Jul 2013 09:43:09 -0700
On Jul 5, 2013, at 5:39 AM, 2551 <2551phil@ gmail.com> wrote: On 5 Jul 2013, at 19:31, Luther Fuller <email@hidden> wrote:
The only significant difference between pdf and rtfd is that pdf is not editable while rtfd is editable.
Perhaps. But that's not relevant to my problem.
What's relevant is that AppleScript can't 'get' rich text. Using something like
tell app "Safari" to get text of document 1
produces a result in plain text. Always does, always will. That's why I need to find either an rtf or pdf solution. Either will do, but the pdf version is looking simpler going on current responses from the list, just because TextEdit is such a pain to script. Bash's textutil can't seem to manage more than one 'style' at a time…but I'm willing to consider (any) other solutions, from whatever angle (I would love a scripting solution that doesn't need GUI/Assistive Devices actions, but that's looking increasingly unlikely). A while back, Bill Cheeseman posted some code for printing to PDF from the front application. This script is based on his code.
tell application "System Events" set appname to name of first process whose frontmost is true end tell
activate application appname tell application "System Events" tell process appname -- insert GUI Scripting statements here keystroke "p" using command down set PDFButton to menu button "PDF" of sheet 1 of window 1 click PDFButton click menu item "Save As PDF…" of menu 1 of PDFButton delay 1 click button "Save" of window 1 end tell end tell
HTHJ |
_______________________________________________
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