I would like some conceptual advice …
If I wanted a service that would provide all associated metadata / hidden info of a selected file, what would be the best way of approaching this?
Would combining mdls with Exiftool output capture everything? Would it be redundant?
Thanks for the thoughts.
I cannot be sure this finds all EXIF metadata, but it seems it does:
on run {input, parameters}
repeat with i in input
tell application "Terminal" to do script "mdls " & quoted form of (POSIX path of (i as alias))
end repeat
tell application "Terminal" to activate
return input
end run
I found it here, a long time ago.
Also you can use do shell script (i prefer) so you don’t need the terminal.
return do shell script "mdls " & quoted form of posixPath[/applescript
Also remember that there is more around a file (the actual data) than metadata. There is also stat can give you information and if you have developer tools installed getFileInfo and DeRez can give you (depening of file type) even more information about the file's data.
Thanks for the feedback.
The derez and filegetinfo both provided additional info.
Now, Is there a command that will remove all associated data from the file? I am trying to either make a service, or a folder that when it receives files, they will be cleaned up for posting.
Should I be starting with xattr -d?
Is there a better way of making files “internet safe” ?
Thanks again.
Well internet safe files is very wide because internet has thousands of different protocols.
over http and mail you have other internet safe files than afp and ftp for instance. You can’t send the old mac font files over http or by mail without compressing while it can be done over afp without any problem.
To answer your question shortly, the only thing you have to do is removing the resource fork from the file (but it can be damaged).
Finder info etc is just a part of the file system and not the file itself so I don’t really see why you should remove these attributes from a file. For the node part, you can’t remove this because the node is also your file locator of your hard drive because the node tells you where it can find the data pieces of your file on the hard drive. Removing the node means no pointer to the actual data and is free to be overwritten (like emptying your trash in the finder).