Hey guys,
I have a script the seemed to work fine with leopard to automatically mount and select the volume from an afp server which looked like this:
on open {dropped_item}
set serverName to "afp://myserver"
set filePath to POSIX path of dropped_item
tell application "Finder" to set theFilename to the name of dropped_item
set dirPath to (switchText from filePath to "" instead of theFilename)
set encodeSpaces to (switchText from dirPath to "%20" instead of " ")
set theText to serverName & encodeSpaces as Unicode text
set a to (switchText from theText to "" instead of "Volumes/")
set the clipboard to "File: " & theFilename & "
" & "Link: " & a
display alert "The Link has been copied to the clipboard" message theFilename
end open
to switchText from t to r instead of s
set d to text item delimiters
set text item delimiters to s
set t to t's text items
set text item delimiters to r
tell t to set t to item 1 & ({""} & rest)
set text item delimiters to d
t
end switchText
If item is dropped in the app, it creates a link like this:
File: MyFile.doc
Link: afp://myserver/to/the/targetfolder
The script seemed to work fine with Mac OS X Leopard. However, Snow Leopard behaves a little different as it mounts the “targetfolder” in the afp path as Volume.
Can anyone help me with this?
Your ideas will be greatly appreciated.
Thanks!
Renante