Change Windows network path to Mac on the clipboard

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
foguetes
Posts: 19
Joined: 19 Oct 2018, 04:58

Change Windows network path to Mac on the clipboard

19 Oct 2018, 05:18

I want to create a script that converts a Windows path into a Mac path when I press Shift+F19 from the clipboard.

I would Shift+Right Click a file > Choose "Copy as Path" from the context menu > Press Shift+F19 to convert to a Mac path.

So I would replace this:

"Z:\Users\Resources\da.lproj"

With this:

/Volumes/Daten/Users/Resources/da.lproj


Here's my latest attempt:

Code: Select all

; convert to mac path

+F19::


Loop
{
    StringReplace, clipboard, clipboard, ", , All
        break
StringReplace, clipboard, clipboard, Z:\, /Volumes/Daten/, All
break
StringReplace, clipboard, clipboard, \, /, All
break

}

return
User avatar
TheDewd
Posts: 1513
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Change Windows network path to Mac on the clipboard

19 Oct 2018, 10:19

Code: Select all

#SingleInstance, Force
#NoEnv

+F19::
	Clipboard := "C:\Users\wcamp0\Downloads\New AutoHotkey Script.ahk"
	RegExMatch(Clipboard, ":(.*)", Path)
	Clipboard := StrReplace(Path1, "\", "/")
	;MsgBox, % Clipboard
return
foguetes
Posts: 19
Joined: 19 Oct 2018, 04:58

Re: Change Windows network path to Mac on the clipboard

20 Oct 2018, 03:52

TheDewd wrote:
19 Oct 2018, 10:19

Code: Select all

#SingleInstance, Force
#NoEnv

+F19::
	Clipboard := "C:\Users\wcamp0\Downloads\New AutoHotkey Script.ahk"
	RegExMatch(Clipboard, ":(.*)", Path)
	Clipboard := StrReplace(Path1, "\", "/")
	;MsgBox, % Clipboard
return
I tried this but it behaves the same way as my script. It only removed the quotation marks.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: hedehede81, OrangeCat and 295 guests