Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Allows you to select an smb text link & right click "Open Network Path" to open it # in a new finder window
# set `pass input` to `as arguments`
# Allows you to select an smb text link
# and right click "Open Network Path" to open it
# in a new finder window
network_path_to_open=$*
network_path_to_open=$(echo $network_path_to_open | sed 's#\\\\#smb://#' )
network_path_to_open=$(echo $network_path_to_open | tr \\ /)
network_path_to_open=$(echo $network_path_to_open | sed 's#<##g' )
network_path_to_open=$(echo $network_path_to_open | sed 's#>##g' )
network_path_to_open=$(echo $network_path_to_open | sed 's#"##g' )
open -n $network_path_to_open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment