• 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: AppleScript --> HTML
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript --> HTML


  • Subject: Re: AppleScript --> HTML
  • From: Nigel Smith <email@hidden>
  • Date: Fri, 25 Jul 2003 12:36:02 +0100

On 25/7/03 0:44, "John Delacour" <email@hidden> wrote:

> If you're using Script Editor 2.0, you can get more style info than
> you need and use this as a basis for your html.
>
>
> get properties of words in paragraph 2 of document "Untitled"

It's a shame that the "style" of the words are based on attribute runs with
"characteristics", and don't include "what" those words are -- variable,
application keyword, and so on.

I had hoped to use:
set formatList to ""
set fileRef to POSIX path of alias <nobreak>
((path to preferences as text) & "com.apple.applescript.plist")
set formatList to every paragraph of (do shell script "cat " & <nobreak>
fileRef & " | sed -n <nobreak>
's/\\(<string>\\)\\(.*\\)\\(<\\/string>\\)/\\2/p' | cut -f3")
return formatList

...to find the AppleScript formatting and match that to the attribute run
properties, but that may prove difficult for a general script -- for example
the font name/style is difficult to match. But for personal use I guess you
could hard code those into a script.

So, pull out all the attribute runs, wrap them in HMTL/CSS tags dependent on
what they are rather than what they look like, then write the HTML file.

Sound feasible?

(I had thought of saving/rewriting the formatting prefs, so as to start from
a known format, but they wouldn't take immediate effect on a recompile.
Bum.)

Later,

Nigel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: AppleScript --> HTML
      • From: John Delacour <email@hidden>
    • Re: AppleScript --> HTML
      • From: Jean-Baptiste LE STANG <email@hidden>
References: 
 >Re: AppleScript --> HTML (From: John Delacour <email@hidden>)

  • Prev by Date: Re: move theFile to thePath replacing no
  • Next by Date: Disk Copy Script
  • Previous by thread: Re: AppleScript --> HTML
  • Next by thread: Re: AppleScript --> HTML
  • Index(es):
    • Date
    • Thread