On Jul 17, 2005, at 4:40 AM, Chris Tracewell wrote:
I am trying to load several images to data cells in a table view.
It works fine except if the path to the file on disk is not the
exact case as the string I construct then it fails. I am using
thousands of product codes from our vendors to construct the file
names and often those codes have case discrepancies with their
associated image files that they supply via the web or CD.
I have tried ignore case but no dice. I suppose this is a UNIX/
Unicode issue. Can anyone point me in a direction on how to make AS
Studio ignore case when I am using "load image"?]
Are you working with files on a UFS (Unix File System) disk? If so,
then you're stuck -- the case really is part of a name, and test1.jpg
is a completely different file than Test1.jpg.
But otherwise, if you're working with files on an HFS disk, and the
string that you've got is a valid path name for the file, then the
limitation must be in the load image command. So what happens if you
do something like
set myGuess to "cobbled together name with possibly wrong case"
-- "Futura:Users:neil:Desktop:BmsIName.TXT"
tell app "Finder"
set theFile to file myGuess
-- document file "BMSINAME.TXT" of folder "Desktop" of
folder "neil" of folder "Users" of startup disk of application "Finder"
set theTrueName to theFile as Unicode text
-- "Futura:Users:neil:Desktop:BMSINAME.TXT"
end tell
The first line to the Finder will tell it to find the file that's
identified by your name string, and the second line will tell it to
return the true name of that file, with proper capitalization.
Of course, permutations with POSIX file and POSIX path are possible,
depending on exactly what load image expects.
Regards,
Neil Faiman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden