Dir and file types

Having trouble using an XCmd or XFcn? Post your questions here.

Dir and file types

Postby vinnie-bob » Mon Feb 25, 2013 7:19 am

I have been playing around with a program to look at jpegs and automatically add Spotlight comments to them using SC & Applescript. This relies on dir to obtain a file list using file type "JPEG". The big problem with this is that not all jpg image files have type or creator information. In particular, if you have any jpg files which have been altered using unix graphic manipulators in terminal (like ImageMagick), the manipulated files lose type and creator information when the unix utility saves them. Then they become invisible to the dir external when you try to create a file list at some time in the future if you rely on file type to create the list. This is also a problem with many downloaded jpg files from the internet, many of which are lacking type and creator information.

The workaround is to use Applescript in place of dir, since Applescript can search for the "type identifier" (which is "public.jpeg" even for files which have no type or creator or after filtering through ImageMagick).

I guess my feature request would be this: can dir be updated to search for "type identifier" information, or "kind" or "name extension" which seem to be more reliable than type and creator these days?
------
vince
------
User avatar
vinnie-bob
 
Posts: 235
Joined: Sun Jul 06, 2008 10:55 am
Location: Des Moines, Iowa, USA

Return to Using Externals

Who is online

Users browsing this forum: No registered users and 1 guest