• 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: Find out in which subfolder a given file resides
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Find out in which subfolder a given file resides


  • Subject: Re: Find out in which subfolder a given file resides
  • From: Christopher Stone <email@hidden>
  • Date: Wed, 14 Oct 2015 15:05:57 -0500

On Oct 14, 2015, at 05:29, Shane Stanley <email@hidden> wrote:
Does the content change often? Another approach would be to have a separate script that builds a local database of all the .jpg files, and then have your script use that local listing.
______________________________________________________________________

This is probably what I'd do if (as Shane inquires) the folder contents is relatively static.

Creating a text file with all the folders in my home folder gives me a 15.5 MB file with about 97,000 lines.

This script using the Satimage.osax will search it in ~ 0.7 seconds on my system – even faster if I turn ON case-sensitive.

-------------------------------------------------------------------------------------------
# REQUIRES Satimage.osax { http://tinyurl.com/dc3soh }
-------------------------------------------------------------------------------------------

set folderDatabase to alias ((path to downloads folder as text) & "FindResult.txt")
set foundItems to fnd("^.+Folder_01$", folderDatabase, true, true) of me

-------------------------------------------------------------------------------------------
--» HANDLERS
-------------------------------------------------------------------------------------------
on fnd(_find, _data, _all, strRslt)
  try
    find text _find in _data all occurrences _all string result strRslt with regexp without case sensitive
  on error
    return false
  end try
end fnd
-------------------------------------------------------------------------------------------

--
Best Regards,
Chris

 _______________________________________________
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

References: 
 >Find out in which subfolder a given file resides (From: Bert Groeneveld <email@hidden>)
 >Re: Find out in which subfolder a given file resides (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Help with Script to mount SMB
  • Next by Date: Re: Shell script to get a list of all subfolders inside a folder
  • Previous by thread: Re: Find out in which subfolder a given file resides
  • Next by thread: Help with Script to mount SMB
  • Index(es):
    • Date
    • Thread