Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mucho

macrumors newbie
Original poster
Mar 16, 2011
2
0
Hello
I 've been using an applescript to copy the path of a folder to the clipboard and I wanted to add the clickability for the PC (which uses other slashes /). I am unsure about how to use the find/replace and then copy to clipboard functions.

Perhaps you can help. Here is what I have so far:


Code:
try
	tell application "Finder"
		set currentPath to (POSIX path of (target of front window as alias))
		#		strWin = ReplaceText("script", "script", "re") of me
		#	strString = currentPath
		#	strString = Replace(strString, "/", vbcrlf)
		set the clipboard to "file://" & currentPath & "
P:\\" & currentPath
		
	end tell
on error
	display dialog "Unable to copy a path to the clipboard. Make sure Finder is referencing a directory/folder within the file system." buttons {"Ok"} with icon caution with title "Error"
end try

thanks in advance
Mucho
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.