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: 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 | # ]