Re: Styled text and non-Gregorian dates
Re: Styled text and non-Gregorian dates
- Subject: Re: Styled text and non-Gregorian dates
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 5 May 2009 20:28:33 -0400
On Tue, May 5, 2009 at 6:24 PM, Philip Aker <email@hidden> wrote:
> set html to quoted form of "<html><head><title>Regular
> Exercise</title><style type='text/css'>body
> {font-family:Papyrus;font-size:21pt;}</style></head><body>Visit the <a
> href='http://en.wikipedia.org/wiki/Giza_pyramid_complex'>pyramids</a></body></html>"
> set rtf to (do shell script "echo " & html & "| textutil -stdin -stdout
> -convert rtf")
> For those of you who don't feel like exercising
Awesome. I hate exercise. Thanks. :)
You can avoid a level of quoting by using a here-document:
set rtf to (do shell script "textutil -stdin -stdout -convert rtf <<EOF
<html><head><title>Regular Exercise</title><style type='text/css'>body
{font-family:Papyrus;font-size:21pt;}</style></head><body>Visit the <a
href='http://en.wikipedia.org/wiki/Giza_pyramid_complex'>pyramids</a></body></html>
EOF")
> set the clipboard to (run script (do shell script "tclsh <<< 'binary scan {"
> & rtf & "} H* res;puts \"«data RTF $res»\";'"))
Ugh, hate to see solutions where run script is masquerading as eval.
It sure is a shame that you can't just cast a string of RTF code with
"as «class RTF »". :\
--
Mark J. Reed <email@hidden>
_______________________________________________
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