Reader's Digest Version: I needed a function to grab the extended properties for a file (specifically Title, Subject, Category ... for LISP files). I wrote this quick and dirty and it appears to work:
(defun _Get_File_Properties_Ex
( file
/ result shell name_space items item
)
;; Get a file's extended properties (Title, Subject, Category ...)
;; returning the result as a list of cons pairs:
;;
;; ( ("Name" . "Drawing.dwg")
;; ("Size" . "42 KB")
;; ("Type" . "DWG File")
;; ("Date Modified" . "2011/03/21 10:57 AM")
;; ...
;; )
(lambda ( / folder_name file_name i count
) )
name_space
'GetDetailsOf
items
)
name_space
'GetDetailsOf
item
i
)
)
result
)
)
)
)
)
)
)
result
)
)
Test run (under XP):
(
_Get_File_Properties_Ex "c:\\tests\\SampleDrawing.dwg")
(
("Name" . "SampleDrawing.dwg")
("Size" . "42 KB")
("Type" . "DWG File")
("Date Modified" . "2011/03/21 10:57 AM")
("Date Created" . "2011/03/10 3:03 PM")
("Date Accessed" . "2011/04/26 1:32 PM")
("Attributes" . "A")
("Status" . "Online")
("Owner" . "COMPANY\\USERNAME")
("Author" . "")
("Title" . "")
("Subject" . "")
("Category" . "")
("Pages" . "")
("Comments" . "")
("Copyright" . "")
("Artist" . "")
("Album Title" . "")
("Year" . "")
("Track Number" . "")
("Genre" . "")
("Duration" . "")
("Bit Rate" . "")
("Protected" . "")
("Camera Model" . "")
("Date Picture Taken" . "")
("Dimensions" . "")
("Episode Name" . "")
("Program Description" . "")
("Audio sample size" . "")
("Audio sample rate" . "")
("Channels" . "")
("Company" . "")
("Description" . "")
("File Version" . "")
("Product Name" . "")
("Product Version" . "")
("DWG Creator Name" . "")
("DWG Creator Version" . "")
("Keywords" . "")
)I could use the black board for the shell object >> next version will, no time right now. PS: Let me know if it works / doesn't work for you. Thanks and cheers, MP.
PS: For use with any file, not just drawings. I'm using it to categorize LISP files regardless of their folder parentage.
Edit: Revised number items the function interrogates for from 34 to 300.
EDIT (John): Removed color tags from CODE block and replaced with AutoLisp code block (for colors).