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


Click here to return to the 'Add file references to anyone's Address Book entry' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add file references to anyone's Address Book entry
Authored by: mark hunte on Feb 11, '06 12:44:19PM
Someone wanted to open a file on their iDisk. so I adapted the script for that.
It uses system events , keystrokes to mount the iDisk...

the path to the file should be: /Volumes/loginnamefor.mac/filepath

 
using terms from application "Address Book"
	on action property
		return "Related Name"
	end action property
	
	on action title for p with e
		if label of e is equal to "file" then
			
			
			return "Open File"
		end if
	end action title
	
	on should enable action for p with e
		return true
	end should enable action
	
	on perform action for p with e
		set thefile to the value of e
		if thefile contains "idisk" then
			tell application "Finder"
				activate
			end tell
			tell application "System Events"
				keystroke "i" using {command down, shift down}
			end tell
			delay 5
			do shell script "open " & quoted form of thefile
		else
			tell application "Finder"
				
				do shell script "open " & quoted form of thefile
				
			end tell
		end if
	end perform action
	
end using terms from

---
mh

[ Reply to This | # ]