• 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: How Do I Create class HTML to put on Clipboard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How Do I Create class HTML to put on Clipboard?


  • Subject: Re: How Do I Create class HTML to put on Clipboard?
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 15 Jun 2016 15:41:33 +0200


Le 15 juin 2016 à 15:11, Shane Stanley <email@hidden> a écrit :

On 15 Jun 2016, at 10:45 PM, Shane Stanley <email@hidden> wrote:

I've never seen «class HTML» on the clipboard

Live and learn. My guess:

use framework "Foundation"
use framework "AppKit" -- for pasteboard

set theHTML to "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"
set pb to current application's NSPasteboard's generalPasteboard()
-- write as html
pb's clearContents()
pb's setString:theHTML forType:"public.html"
-- read as html
set theText to (pb's stringForType:"public.html") as text

-- 

Hello Shane

I don't know if it makes a meaningful difference but in numerous html files (more than 16000) available on my HD, the header is different.
It is : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


Yvan KOENIG (VALLAURIS, France) mercredi 15 juin 2016 15:41:26



 _______________________________________________
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:
    • Re: How Do I Create class HTML to put on Clipboard?
      • From: Shane Stanley <email@hidden>
References: 
 >How Do I Create class HTML to put on Clipboard? (From: Jim Underwood <email@hidden>)
 >Re: How Do I Create class HTML to put on Clipboard? (From: Christopher Stone <email@hidden>)
 >Re: How Do I Create class HTML to put on Clipboard? (From: Shane Stanley <email@hidden>)
 >Re: How Do I Create class HTML to put on Clipboard? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: How Do I Create class HTML to put on Clipboard?
  • Next by Date: Problem with POSIX paths?
  • Previous by thread: Re: How Do I Create class HTML to put on Clipboard?
  • Next by thread: Re: How Do I Create class HTML to put on Clipboard?
  • Index(es):
    • Date
    • Thread