 OldTicks = 0
 
 ;check for cygwin path
+global CygPath
 CygPath = C:\Program Files (x86)\cygwin
 IfNotExist %CygPath%
 	CygPath = C:\Cygwin
 
+global BrowserPath
 BrowserPath = C:\Program Files (x86)\Mozilla Firefox\firefox.exe
 IfNotExist %BrowserPath%
 	BrowserPath = "C:\Users\vleeshue\AppData\Local\Google\Chrome\Application\chrome.exe"
 
+global WTWPath
 WTWPath = C:\Program Files\WTW\WTW.exe
 IfNotExist %WTWPath%
 	WTWPath = C:\Program Files\K2T\WTW\WTW.exe

	if %ErrorLevel% = 0
	{
		RunWait, % "Z:\src\optipng\support\optipng.exe -o1 " . PNGFileName, "Z:\", Hide
		RunWait, % CygPath . "bin\convert.exe " . PNGFileName . " -quality 80 " . JPGFileName, "Z:\", Hide
		FileGetSize, JPGFileSize, % JPGFileName
		FileGetSize, PNGFileSize, % PNGFileName
		if % PNGFileSize > JPGFileSize

UploadFiles()
{
	ToolTip, Uploading files..., -1920+50, 50
	RunWait, %CygPath%\bin\mintty.exe --exec /bin/bash -l -c send_to_pinkyard.sh|clip, %CygPath%/bin
	ToolTip
	return
}
