Re: open for access command, more re my original query
Re: open for access command, more re my original query
- Subject: Re: open for access command, more re my original query
- From: Shane Stanley via AppleScript-Users <email@hidden>
- Date: Thu, 14 May 2020 09:47:45 +1000
On 14 May 2020, at 8:03 am, le0car--- via AppleScript-Users
<email@hidden> wrote:
>
> the files are not text files, rather are rtf "rich text format"
You can extract the text directly using AppleScriptObjC:
use AppleScript version "2.5" -- macOS 10.11 or later
use framework "Foundation"
use framework "AppKit"
use scripting additions
set theFile to choose file
set theAttString to current application's NSAttributedString's alloc()'s
initWithURL:theFile options:(missing value) documentAttributes:(missing value)
|error|:(missing value)
set theString to theAttString's |string|() as text
That should work with any document format that TextEdit can open.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
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