Sunday, August 19, 2018

#1 2018-05-08 10:23:59 am

Registered: 2017-11-25
Posts: 43

Extended Info of File or Folder

Hi All,

I spent a bit of time writing this little script which I use to extract the extended info (aka "More Info") of file or folder. Some useful information (at least for me) is located here.
You will end up with a file, which then you can easily parse for what you might need....



use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

set myFile to choose file

tell application "Finder"
   set ParentFolder to (container of myFile) as text
end tell

# usual Info
info for myFile -- here you get the "normal" info
tell (info for myFile) to set theFile_name to name

#extended Info
set thePath to quoted form of POSIX path of myFile
set mytext to do shell script "mdls " & thePath

set posixPath to POSIX path of (ParentFolder & "_" & theFile_name & time of (current date) & "__ExtendedInfo.rtf " as string)

write_text_to_file(posixPath, mytext)

on write_text_to_file(the_file, the_text)
   set file_ref to open for access the_file with write permission
   set eof file_ref to 0
   write the_text to file_ref as «class utf8»
   close access file_ref
end write_text_to_file

Filed under: info, More info



#2 2018-05-08 01:57:00 pm

Registered: 2017-11-25
Posts: 43

Re: Extended Info of File or Folder

I just resized that Metadata Lib 2.0.0 from Shane might do this ...  and much more ....


Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)