• 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
open for access command, more re my original query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

open for access command, more re my original query


  • Subject: open for access command, more re my original query
  • From: le0car--- via AppleScript-Users <email@hidden>
  • Date: Wed, 13 May 2020 22:03:09 +0000 (UTC)

re members responses, It seems I have heard before "open for access command, is
suitable, strictly speaking, for text files",

concerning specifics of format of the files I am trying to have my script work
with. the files are not text files, rather are rtf "rich text format" (a format
which supports, color characters, special characters etc.), I made the files in
the word processor TextEdit, that is, simply the word processor that comes with
macintosh os.
I realize that this application doesn't script well, but that happens to be the
format of the stuff I have all typed up.

related: I'd considered: I have found that these rtf files may be opened in
BBEdit, then saved anew from that application, the newly saved files shall be
text files; I find then, that open for access acting upon these text files,
(then read), produces an ok result, that is, the document's text alone, without
the internal data baggage that I've been plagued with.

But that's making things more complicated, not less.


Re Yvan's reply, your posted suggested script segment. looks esoteric to me (my
limited AppleScript skills), still, I would play with it, yet — if I understand
you correctly, this script writing (all of it) is pert to txt files, and not
rtf files.

If the documents are text ones you may use:

set t to ""
set L to choose file of type {"txt"} with multiple selections allowed
repeat with ff in L
        set someText to read ff as «class utf8»
        set myText to my recolle(paragraphs 1 thru 4 of someText, return) &
return & return
        set t to t & myText
end repeat
set the clipboard to t
#=====

on recolle(L, d)
        local oTIDs, t
        set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text
item delimiters, d}
        set t to L as text
        set AppleScript's text item delimiters to oTIDs
        return t
end
recolle


Regards, Leo

 _______________________________________________
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: open for access command, more re my original query
      • From: Shane Stanley via AppleScript-Users <email@hidden>
    • Re: open for access command, more re my original query
      • From: "Stockly, Ed via AppleScript-Users" <email@hidden>
  • Prev by Date: Re: Home Folder Name Change
  • Next by Date: Re: open for access command, more re my original query
  • Previous by thread: Re: AppleScript-Users Digest, Vol 17, Issue 61
  • Next by thread: Re: open for access command, more re my original query
  • Index(es):
    • Date
    • Thread