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


Click here to return to the 'One way to share links to networked files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
One way to share links to networked files
Authored by: blumenberg on Mar 23, '09 12:38:28PM

Mmh, mixed results -- I did the following things:

A) to get the filepath like:
"/Volumes/VOLUMENAME/FOLDERNAME/FILENAME"

  1. AppleScript from "ctierney": works besides "Umlaute" are garbled
  2. AppleScript from "Spartacus": no need for a list of files
  3. drag'n'drop file to a TextMate document: works besides "Umlaute" are garbled
  4. drag'n'drop file to a Terminal window: works besides spaces get escaped
  5. Contextual Menu like "haralds" (FilePathToClipCMPlugin.plugin) or FileUtilsCM.plugin w/ "copy file path": works perfect
  6. drag'n'drop file to Spotlight window ("thegooch49" tip): works perfect
and

copy the previous copied filepath to a highlighted word via "Menu > Format > Linků" in TextEdit or Mail and add in front of the filepath "file://" -- this "linked" text is draggable to the finder and becomes a ".fileloc" file

B) or better:
"file:///Volumes/VOLUMENAME/FOLDERNAME/FILENAME"

  1. drag'n'drop file (rtf) to Firefox window : Firefox ask for download
  2. drag'n'drop folder to Firefox window : Firefox shows list/index of folder -- files and folders are links

C) or best:
"afp://BONJOURSERVERNAME.local/Volumes/VOLUMENAME/FOLDERNAME/FILENAME"

  • no readymade solution - besides:

D) combine the spotlight or the Contextual Menu tip w/ TextExpander like: prepare a snippet like "file://" (I used "flx") -- or for the additional function to mount an unmounted volume: "afp://BONJOURSERVERNAME.local" -- and put it together in Mail ("Add Linků") or TextEdit (see A))

Thinking: I'm sure there is someone who can build an AppleScript -- maybe with a dialogue -- to make this even easier



[ Reply to This | # ]
One way to share links to networked files
Authored by: chleuasme on Mar 23, '09 01:02:33PM

For the manual creation of .fileloc file you described in A, you can simply drag the file or folder to the text box of the dialog for link creation (in TextEdit, Mail, ...) and add the prefix "file://". Another solution is to drag to a Finder window the content of the Firefox's adress bar after the drag of a file or folder. The Applescript I wrote above may be an easier solution, though ;-)



[ Reply to This | # ]
One way to share links to networked files
Authored by: chleuasme on Mar 23, '09 02:02:16PM
To create .afploc files, i propose this Applescript :
set afploc_begin to "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
	<key>URL</key>
	<string>"

set afploc_end to "</string>
</dict>
</plist>"

set cmd_txt to (quoted form of afploc_begin) & "$afpurl" & (quoted form of afploc_end)


tell application "Finder"
	set elts to get selection
	repeat with elt in elts
		set f to POSIX path of (elt as string)
		set fn to name of elt
		set p to POSIX path of ((container of elt) as string)
		set afploc to quoted form of (p & fn & ".afploc")
		set s to text returned of (display dialog "Enter the server for " & f default answer "afp://")
		set afpurl to s & (do shell script "/bin/echo -n " & f & " | ruby -ruri -p -e '$_=URI.encode$_' | sed 's:^/Volumes::'")
		
		do shell script "afpurl=" & afpurl & "; echo " & cmd_txt & " > " & afploc
	end repeat
end tell
(again, use at your own risk, with same problems on files or folder with a name containing the character '/')

I don't know a way to obtain the afp server given a mount point, to avoid the dialog.

[ Reply to This | # ]

One way to share links to networked files
Authored by: ctierney on Mar 23, '09 07:17:01PM
This version may preserve Umlaute:
http://putnamhill.net/applescript/copy-unix-paths

[ Reply to This | # ]
One way to share links to networked files
Authored by: blumenberg on Mar 24, '09 05:44:53AM

yes, it's working. thanks for the "umlaut" modification.



[ Reply to This | # ]