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


Click here to return to the 'Find the email a saved attachment was sent with ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Find the email a saved attachment was sent with
Authored by: Sesquipedalian on Jan 25, '13 10:43:53AM
No sooner said than done, kirkmc. This can be saved as an application in Script Editor, or as a script in ~/Library/Scripts/Applications/Finder (make the folder as necessary). Some trivial adaptation could also turn it into a service using Automator's Run AppleScript action (I'll leave that as an exercise for the reader).
on open thefiles
	repeat with thisfile in thefiles
		mainscript(thisfile)
	end repeat
end open

on run
	try
		tell application "Finder" to set thefiles to its selection
		if result is {} then error
	on error
		set thefiles to choose file with multiple selections allowed
	end try
	
	repeat with thisfile in thefiles
		mainscript(thisfile as alias)
	end repeat
end run

on mainscript(thefile)
	set filepath to POSIX path of thefile
	do shell script "open $(mdls " & quoted form of filepath & " | grep 'message:' | cut -d\\\" -f2)"
end mainscript


[ Reply to This | # ]
Find the email a saved attachment was sent with
Authored by: PantherMan on Jan 25, '13 08:23:21PM

The script works perfectly, Thank You. Its one of those things that you don't realize are invaluable until you very desperately need it. Its so useful that I think it should be built into OS X.

---
World Peace Through Better Computing
The Macintosh OS



[ Reply to This | # ]