Rép: How to manage image-list
Rép: How to manage image-list
- Subject: Rép: How to manage image-list
- From: Yvan KOENIG <email@hidden>
- Date: Fri, 12 Jun 2009 17:41:44 +0200
Le 12 juin 2009 à 16:26, Philip Aker a écrit :
On 2009-06-10, at 14:20:43, Pascal van den Bulck wrote:
That’s exactly my goal: finding a specific image and placing it
into Quark. And it works too, but it works slow with large amounts
of images.
I’m currently using listcomparison/list position to place some
logo-images (less than 20 images), but how would you go about
working with index files?
Would you use records e.g {filename, filepath} ?
What I’m searching for is a method that will leap through the
amount of images:
Product “123-456-78” has corresponding images whose name
contains “12345678”, e.g. “12345678-01”, “12345678-02”
Is there a way to check the first two numbers, the second two, the
third two, the seventh and finaly the last number ?
In this case, any image that would not start with “12” would be
ignored, with “1234”, with “123456” and so on until you
find the specific images.
There are a couple of useful techniques to speed up list searches
and string compares but instead of loading every file but I think
it better to limit the list size in the first place. Something like
this:
set fold to (choose folder)
set name_key to "123-456-78"
set prefix to (words of name_key as text) -- "12345678"
tell application "System Events"
every file of fold whose name begins with prefix and kind contains
"image"
end tell
CAUTION:
12345678xyz.dmg 's kind also contain the string "image".
So it's easy to imagine that the script may grab such an item ;-)
Yvan KOENIG (from FRANCE vendredi 12 juin 2009 17:03:08)
_______________________________________________
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