🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #20216

Re: How to get files whose name ends with (anything in a list) ?

#20216
From: Shane Stanley
Date: Sun, 20 Oct 2002 07:19
32 lines
1885 bytes
in article 1de63b23.-1@WebX.la2eafNXanI, Richard Ronnback wrote:

> I need to get a list of files whose file names ends with any of the file
> suffix I set in a list. Below is a pseudo-code example of what I want to do.
> Can anybody help?
> 
> tell application "Finder"
> set myFileSuffixes to {"PDF", "EPS", "TIFF", "TIF"}
> set myFolder to (choose folder with prompt "Please select the folder that
> contains the files you want to place.")
> 
> set myFiles to files of myFolder whose name ends with (whatever is in
> myFileSuffixes) 
> 
> end tell

You can't really do it in one go; you'll have to get them one extension at a
time.

You could always do something like this:

    every file of myFolder whose file type is in {"TEXT", "jpeg", ...}

but under OS X, not all files have a file type.

Hang on -- if it's X, you could also use:

    every file of myFolder whose name extension is in {"PDF", "EPS", "TIFF",
"TIF"}

-- 
Shane Stanley,  sstanley@myriad-com.com.au
Technical Details
Message-ID: <B9D89632.417A6%sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.rt.ru!rt.ru!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de63b23.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,13420ed1ecfce0f3,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-10-21 03:56:06 PST
From: Shane Stanley <sstanley@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.rt.ru!rt.ru!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: How to get files whose name ends with (anything in a list) ?
Message-ID: <B9D89632.417A6%sstanley@myriad-com.com.au>
Date: Sun, 20 Oct 2002 00:19:47 -0700
References: <1de63b23.-1@WebX.la2eafNXanI>
Lines: 38
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.6
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit