Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: A Finder plug-in to access file metadata' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: A Finder plug-in to access file metadata
Authored by: magnamous on Jun 27, '05 07:57:48PM
I made my own workflow that uses a combination of the applescript from the post by Nyhthawk and the post by adrianm (I'm not a coder, so the version I cobbled together was easier for me to understand). My version puts the metadata for each file selected in the Finder into a separate text file in TextEdit. I wanted (but couldn't figure out how) to get all of the text files to be combined into one big text file afterward. If anyone can figure out how to do that, I'd appreciate it. Here's my workflow:

Get Selected Finder Items
Run Applescript:

on run {input, parameters}
repeat with i in input
do shell script "mdls " & quoted form of (POSIX path of (i as alias)) & " | open -f"
end repeat
return input
end run


[ Reply to This | # ]

10.4: A Finder plug-in to access file metadata
Authored by: russs on Jun 28, '05 02:24:50AM
This code will combine all the results into just one list as requested:
on run {input, parameters}
	tell application "Finder"
		set ppath to "" --empty string to initialize variable because below we set it to itself and a file path from the list
		repeat with this_item in input
		set ppath to ppath & quoted form of (POSIX path of this_item) & " " --quoted space character to separate paths as they get appended one at a time
		end repeat
		do shell script "mdls " & ppath & " | open -f" --now ppath contains all selected files' paths
	end tell
end run


[ Reply to This | # ]
10.4: A Finder plug-in to access file metadata
Authored by: magnamous on Jun 28, '05 05:37:25PM
Well, for some reason that script didn't work for me. When I pasted it in, I got this error:

Can't make «class docf» "Picture 1.png" of «class cfol» "Desktop" of «class cfol» "magnamous" of «class cfol» "Users" of «class sdsk» of application "Finder" into the expected type. (-1700)

But I modified the script and integrated it with the other versions and came up with this, which seems to work well:


on run {input, parameters}
	set ppath to "" --empty string to initalize variable before we manipulate it
	repeat with i in input
		set ppath to ppath & quoted form of (POSIX path of (i as alias)) & " "
		--quoted space character to separate paths as they get appended
	end repeat
	do shell script "mdls " & ppath & " | open -f"
	-- run the command with all of the files' paths
	return input
end run

Thanks for helping modify this script to suit my preferences!

[ Reply to This | # ]