• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Styled text and non-Gregorian dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • "C" language continue statement in applescript
      • From: Satyam Satyanarayana <email@hidden>
    • Re: Styled text and non-Gregorian dates
      • From: Philip Aker <email@hidden>
References: 
 >Re: Styled text and non-Gregorian dates (From: Christopher Nebel <email@hidden>)
 >Re: Styled text and non-Gregorian dates (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Image Resolution
  • Next by Date: Scripting MSWord
  • Previous by thread: Re: Styled text and non-Gregorian dates
  • Next by thread: Re: Styled text and non-Gregorian dates
  • Index(es):
    • Date
    • Thread