 
 
 ;other functionalities
+
+;autohotkey - reload this script
 !F12::Reload
-!M:: ;maximize active window
+
+;maximize active window
+!M::
 	ActiveHwnd := WinExist("A")
 	PostMessage 0x112, 0xf030 ;WM_SYSCOMMAND, SC_MAXIMIZE
 	return
-!R:: ;restore active window
+
+;restore active window
+!R::
 	ActiveHwnd := WinExist("A")
 	PostMessage 0x112, 0xf120 ;WM_SYSCOMMAND, SC_RESTORE
 	return
-!W:: ;minimize active window
-	if WinActive("WTW$") {
+
+;minimize active window
+!W::
+	if WinActive("WTW$")
+	{
 		WinHide
-	} else {
+	}
+	else
+	{
 		ActiveHwnd := WinExist("A")
 		PostMessage 0x112, 0xF020 ;WM_SYSCOMMAND, SC_MINIMIZE
 	}
 	return
+
+;always on top
 !A::WinSet, AlwaysOnTop, Toggle, A
-
-
 
 ;transparency
 #1::WinSet, Transparent, 0, A

	return fileName
}

UploadFiles()
{
	ToolTip, Uploading files..., -1920+50, 50
	RunWait, C:\Program Files (x86)\cygwin\bin\mintty.exe /bin/bash -l -c send_to_pinkyard.py|clip, C:\Program Files (x86)\cygwin
	ToolTip
	return
}

MakeScreen(arguments)
{
	baseFileName := "Z:\hub\pinkyard\queued\" . RandomFileName()
	PNGFileName := "Z:\tmp.png"
	JPGFileName := "Z:\tmp.jpg"
	RunWait, % "C:\program files (x86)\scrsh.exe --path " . PNGFileName . " " . arguments, "Z:\", Hide
	if %ErrorLevel% = 0
	{
		RunWait, % "Z:\src\optipng\support\optipng.exe -o1 " . PNGFileName, "Z:\", Hide
		RunWait, % "C:\Program Files (x86)\cygwin\bin\convert.exe " . PNGFileName . " -quality 80 " . JPGFileName, "Z:\", Hide
		FileGetSize, JPGFileSize, % JPGFileName
		FileGetSize, PNGFileSize, % PNGFileName
		if % PNGFileSize > JPGFileSize
		{
			path1 := JPGFileName
			path2 := baseFileName . ".jpg"
		}
		else
		{
			path1 := PNGFileName
			path2 := baseFileName . ".png"
		}
		FileCopy, % path1, % path2
		FileDelete, % JPGFileName
		FileDelete, % PNGFileName
		SoundPlay, Z:\clutter\sounds\ping.wav
	}
	return path
}

OnClipboardChange:
	if (A_EventInfo == 1) and (SubStr(clipboard, 1, 7) == "http://")
	{
		StringReplace, clipboard, clipboard, `%5b, [, All
		StringReplace, clipboard, clipboard, `%5d, ], All
	}
	return

FRun(window, path, folder)
{
	if (!window or !WinExist(window))
	{
		Run, %path%, %folder%
	}
	else
	{

	}
	return

;explorer
#IfWinActive ahk_class CabinetWClass
	;new folder
