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: Shane Stanley <email@hidden>
- Date: Mon, 30 Jun 2014 10:48:33 +1000
On 30 Jun 2014, at 10:31 am, Jim Weisbin <email@hidden> wrote:
Looks like I will have a lot more work to do to get exact matches.
Not really. You can just loop through:
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 set theText to paragraphs of theText
set foundNames to {} repeat with anEntry in theText set theoffset to offset of space in anEntry set anEntry to text (theoffset + 1) thru -1 of anEntry if listOfFileNames contains anEntry then set end of foundNames to anEntry end if end repeat return theText
foundNames
-- Shane Stanley < email@hidden> < www.macosxautomation.com/applescript/apps/> |
_______________________________________________
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