Re: AS how to check if a file name matches a string in a text file
Re: AS how to check if a file name matches a string in a text file
- Subject: Re: AS how to check if a file name matches a string in a text file
- From: Jim Weisbin <email@hidden>
- Date: Sun, 29 Jun 2014 15:18:23 -0400
On Jun 29, 2014, at 3:00 PM, koenig.yvan wrote: You may use TextEdit to read the file's contents with this kind of code :
set theFilePath to (path to desktop as text) & "Sans titre.rtf"
tell application "TextEdit" open file theFilePath set theText to text of document 1 end tell theText
But maybe there is a way to do the same using an Unix command.
Thanks, this helps a lot.
I mentioned shell because sed would be the easiest way to find a text string, I think, but I’m sure it can be done in AS.
Jim Weisbin | C.T.O. | human | 138 Fifth Avenue | 3rd Floor | New York, NY | 10011 | (212) 352-0211 | (917) 375-2272 | Los Angeles Office | 2046 Broadway | Santa Monica, CA | 90404 | (310) 264-0211 telephone | www.humanworldwide.com Click here to view our online reel
|
_______________________________________________
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