open for access command
open for access command
- Subject: open for access command
- From: le0car--- via AppleScript-Users <email@hidden>
- Date: Sun, 10 May 2020 19:57:20 +0000 (UTC)
It is helpful with my work, for me to be able to see, at once, the top portions
of a series of documents, documents that I am always editing up. I have written
a script for the purpose (outline of it below). The script works, yet it opens
and shuts a startling number of document windows for its function, rather
disturbing to look at.
I'd hopes of improving matters, by using using open for access command, instead
of open. Sought advantage that that command would circumvent need of opening
and shutting all the document windows, thought too (but not sure) that TextEdit
application would not even need to launch. I have written a working draft of
such script, that is, using open for access, followed by read command (i.e.
[...where f is a file reference] "open for access f", then, "read f" ). While
my draft works, it's of no us to me as the return is both internal data of the
file along with the paragraphs of text the document contains (in other words, a
mess). Wish I knew command's parameter for returning only the document's
paragraphs without the internal data (if there is one), or else wish I know a
way to strip the internal data away from the combined internal data and
document's paragraphs (but similarly, doubt there is such way). Any ideas I'd
appreciate. PS potential respondents, I'm not at computer every day, so shall
be probably several days with reply
here is portion of my script, as it is currently.
my variable "L" is set to a list of file references; these are the files in a
particular folder, the files that I want the script to work on. I use a repeat
construction, in conjunction with "rest of" to have the script act on all these
files one at a time. My variable "t" starts out set to empty string, at the
script's conclusion, it becomes the content that I wanted, and, then, assigned
to the clipboard, I can paste the content anywhere I want:
set t to ""
tell application "Finder"
set f to first item of L
tell application "TextEdit"
set ff to f as alias
open ff
paragraphs 1 thru 4 of text of front document & return & return
set t to t & result
close front document
end tell
end tell
set the clipboard to t
_______________________________________________
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