• 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
Re: AS how to check if a file name matches a string in a text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 20:31:50 -0400

Shane Stanley wrote:


Unfortunately that will also flag a match for things like "uncomfortable". Inserting:

set theText to paragraphs of theText

should fix it, given that the OP said each name would be in a paragraph of its own.

This turns out to be way easier, and also way more complicated, then I thought.

I was able to easily write a program that opens Textedit, gets all the text into a variable, and checks if filenames (folder or files) dragged onto the program exists in that document, using “if x contains y..."

However, my difficulty is this:

The way files are listed in the document, they have a version number appended onto the beginning of the name, and no extension. So I check to see if the filename, less the extension, has a match. The problem is, suppose the document contains the text:
“v01 Some file whatever”
And one of my files is called “Some file.aif”

It will flag as a match.

Looks like I will have a lot more work to do to get exact matches.


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

  • Follow-Ups:
    • Re: AS how to check if a file name matches a string in a text file
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: AS how to check if a file name matches a string in a text file
  • Next by Date: Re: AS how to check if a file name matches a string in a text file
  • Previous by thread: Re: AS how to check if a file name matches a string in a text file
  • Next by thread: Re: AS how to check if a file name matches a string in a text file
  • Index(es):
    • Date
    • Thread