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: chleuasme on Mar 23, '09 04:08:58PM
Thanks!

If it can helps, I then give the new version of the two scripts

  • create .fileloc file for the selected items of the Finder:
    tell application "Finder"
    	repeat with elt in (get selection)
    		set filepath to POSIX path of (elt as string)
    		set filename to name of elt
    		set parentdir to container of elt
    		set fileurl to do shell script "/bin/echo -n file://" & filepath & " | ruby -ruri -p -e '$_=URI.encode$_'"
    		
    		make new internet location file at parentdir to fileurl with properties {name:filename}
    	end repeat
    end tell
    
  • create .afploc file for the selected items of the Finder:
    tell application "Finder"
    	repeat with elt in (get selection)
    		set filepath to do shell script "echo " & (POSIX path of (elt as string)) & " | sed 's:^/Volumes::'"
    		set filename to name of elt
    		set parentdir to container of elt
    		set s to text returned of (display dialog "Enter the afp server for " & filepath default answer "afp://")
    		set afpurl to s & (do shell script "/bin/echo -n " & filepath & " | ruby -ruri -p -e '$_=URI.encode$_'")
    		
    		make new internet location file at parentdir to afpurl with properties {name:filename}
    	end repeat
    end tell


[ Reply to This | # ]