Re: Find out in which subfolder a given file resides
Re: Find out in which subfolder a given file resides
- Subject: Re: Find out in which subfolder a given file resides
- From: Bert Groeneveld <email@hidden>
- Date: Wed, 14 Oct 2015 10:19:45 +0200
Hi Axel, thank you for your answer. In Terminal: execution time is 1 minute and 40 seconds when searching a folder with 2.000 subfolders and 20.000 files.
Depending in which folder the file is (in folder A, B, …. or Z) the result shows up earlier in the Terminal window, but the Find process continues (there could be more files with the same name in different subfolders) and always ends after 1:40.
In my script I need to places 70, 80 or more images, so this method is too slow I would say.
Bert.
> On 14 okt. 2015 (week 42), at 09:01, Axel Luttgens <email@hidden> wrote:
>
>
>> Le 13 oct. 2015 à 21:11, Bert Groeneveld a écrit :
>>
>> Hi, here I am again,
>>
>> I am working on a script that tells InDesign CS6 (on OS 10.10.5) to auto-layout folder pages. I’m almost ready with the script, except for the part where I need to place images from a folder called “Highres_Images”. This folder contains many subfolders and is on a mounted server volume. At some given moment when the script runs I have a variable that contains just the name of a certain image, for example: set myImage to “picture123.jpg”. To be able to place this image on an InDesign page I need the full HFS path of the image.
>> The image “picture123.jpg” is somewhere inside the “Highres_Images" folder. This folder contains many, many subfolders, which contain subfolders, etc, etc, several levels deep. I don’t know in which subfolder the image is.
>>
>> […]
>>
>> ps. I’m absolutely sure there are only jpg and some psd files inside the folder, so there shuldn’t be a problem with invisible files, packages, etc.
>
> Hello Bert,
>
> If I understood you correctly, you need to find a file named "picture123.jpg" residing, more or less deeply, somewhere within a folder named "Highres_Images". That folder is on a volume mounted from some server.
>
> Indeed, making use of the Finder against a file server often proves very taxing: for each item it has to handle, the Finder tends to query a lot of metadata, even if it won’t do anything with it.
>
> So, if you allow, a quick exploratory test.
>
> Let’s say the server volume is mounted at /Volumes/Sharepoint, and that folder "Highres_Images" is located at the first level; the relevant path would thus be /Volumes/Sharepoint/Highres_Images.
> Searching for a file named "picture123.jpg" could be achieved with:
>
> find '/Volumes/Sharepoint/Highres_Images' -type f -name 'picture123.jpg'
>
> Even if not strictly required in this precise case, I’m quoting the two strings as a reminder (in the general case, such strings would need to be quoted with "quoted form of" for an invocation from AppleScript).
>
> Could you try above command (with the path and/or file name adjusted to your context) in Terminal.app and see whether it yields expected results, and that within a reasonable amount of time?
>
> Axel
>
>
>
>
> _______________________________________________
> 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
_______________________________________________
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