• 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
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]

AS how to check if a file name matches a string in a text file


  • Subject: 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 12:28:56 -0400

Hello. I’m fairly comfortable writing AS, but not an expert by any means.

I need to be able to do the following, and am looking for some pointers before I begin:

Open a text document (read-only is fine). The document will always be RTF format, created with TextEdit, so I think that precludes any kind of shell scripting to search it’s contents.

Open a folder and iterate through the filenames there (filenames only, no paths. That part is easy).

For each file name, see if it that exact name matches a line of text in the text doument. Lines are paragraphs with the normal Unix delimiters I think (not sure how it’s done in RTF).

Final dialog box will show a list of all matched filenames and total number of files dropped on the AS app.

My biggest question is, should I try to do this via TextEdit’s AS dictionary, or is there another way I should be thinking about?

I could insist that the text doument be plain text instead, if that makes it much easier.

Thanks in advance.

—— Jim Weisbin, email@hidden

 _______________________________________________
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: "koenig.yvan" <email@hidden>
  • Prev by Date: bug with Keynote's "slide number"
  • Next by Date: Re: AS how to check if a file name matches a string in a text file
  • Previous by thread: bug with Keynote's "slide number"
  • Next by thread: Re: AS how to check if a file name matches a string in a text file
  • Index(es):
    • Date
    • Thread