Amphotography

Opening 64bit Photoshop instead of 32bit photoshop

7 posts in this topic

Long story short I had someone make a script to open raws in Photoshop and then apply an action on them which is then saved as a jpeg in another folder. However the script only opens 32bit instead of 64bit. The guy has disappeared and no way of contacting him. Im even newer than a new starter to this stuff but I get the theory. From what I can see theres no 'run' command and the way it opens it is via creating it as an object with 'photoshop.application' do I need the script to call different dll's? Or is there another name for the 64bit version of Photoshop? Any help truely appreciated. Thanks in advance.

Share this post


Link to post
Share on other sites



Hi, Amphotography. Are you saying you have both 32bit and 64bit versions installed, and one to open one over the other? Or are you saying it is failing to create the object because you have 64bit installed? If it is the latter, try adding the following to your script before compiling it:

#pragma compile(x64, true)

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I have both 32bit and 64bit versions installed. Unfortunately you cant have the 64 bit version without the 32 being installed.

 

I have attached all the code. It creates the object no problem but it creates it with the 32bit version and thus opens the 32 bit version. I would like it to use the 64 bit version (the 64 bit version allows more ram to be assinged to the program which is required for the script to work properly)

 

This code was originally build for Photoshop CS5 but we have upgraded our systems to CS6 (yes I know its not the most recent version but this issue came up a long time ago and since then we have abandoned fixing it. BUT I'm looking back into it)

#region
    #AutoIt3Wrapper_icon=..\app.ico
    #AutoIt3Wrapper_Compression=3
    #AutoIt3Wrapper_Res_Description=PhotoShop Automation etc.: RAW processing
    #AutoIt3Wrapper_Res_Fileversion=0.0.0.1
#endregion
#region Header
#endregion Header
#region Local Variables and Constants
    Dim $MSGID[1][6] = [[0, 0, 100, DllCallbackRegister("_queue", "none", ""), 0, "lib10rsZd"]]
    Dim $MSGQUEUE[1][2] = [[0]]
    Const $MSG_WM_COPYDATA = 74
    Local $ONMESSAGESEXIT = OnAutoItExitRegister("OnMessagesExit")
    Local $WMINT = 0
    Local $QEINT = 0
#endregion Local Variables and Constants
#region Public Functions
    Func _MSGRECEIVERLIST()
        Local $WLIST = WinList(), $LENGHT = StringLen($MSGID[0][5])
        Dim $RLIST[1] = [0]
        For $I = 1 To $WLIST[0][0]
            If StringRight($WLIST[$I][0], $LENGHT) = $MSGID[0][5] Then
                ReDim $RLIST[$RLIST[0] + 2]
                $RLIST[0] += 1
                $RLIST[$RLIST[0]] = StringTrimRight($WLIST[$I][0], $LENGHT)
            EndIf
        Next
        Return $RLIST
    EndFunc
    Func _MSGREGISTER($SIDENTIFIER, $SFUNCTION)
        Local $ID, $TITLE
        Local $I, $J = 0, $K, $L, $B, $T
        If (Not IsString($SIDENTIFIER)) Or (Not IsString($SFUNCTION)) Or ($MSGID[0][3] = 0) Or (StringStripWS($SIDENTIFIER, 8) = "") Then
            Return SetError(1, 0, 0)
        EndIf
        $SFUNCTION = StringStripWS($SFUNCTION, 3)
        $T = StringLower($SIDENTIFIER)
        For $I = 1 To $MSGID[0][0]
            If StringLower($MSGID[$I][1]) = $T Then
                $J = $I
                ExitLoop
            EndIf
        Next
        If $J = 0 Then
            $TITLE = $SIDENTIFIER & $MSGID[0][5]
            If ($SFUNCTION = "") Or (IsHWnd(_WINHANDLE($TITLE))) Then
                Return SetError(0, 0, 1)
            EndIf
            $ID = 1
            Do
                $B = 1
                For $I = 1 To $MSGID[0][0]
                    If $MSGID[$I][0] = $ID Then
                        $ID += 1
                        $B = 0
                        ExitLoop
                    EndIf
                Next
            Until $B
            If $MSGID[0][0] = 0 Then
                _START()
                If @error Then
                    Return 0
                EndIf
            EndIf
            ReDim $MSGID[$MSGID[0][0] + 2][6]
            $MSGID[$MSGID[0][0] + 1][0] = $ID
            $MSGID[$MSGID[0][0] + 1][1] = $SIDENTIFIER
            $MSGID[$MSGID[0][0] + 1][2] = $SFUNCTION
            $MSGID[$MSGID[0][0] + 1][3] = GUICreate($TITLE)
            $MSGID[$MSGID[0][0] + 1][4] = 0
            $MSGID[$MSGID[0][0] + 1][5] = 0
            $MSGID[0][0] += 1
            If $MSGID[0][0] = 1 Then
                GUIRegisterMsg($MSG_WM_COPYDATA, "_WM_COPYDATA")
            EndIf
            Return SetError(0, 0, $ID)
        EndIf
        If $SFUNCTION > "" Then
            $MSGID[$J][2] = $SFUNCTION
            $ID = $MSGID[$J][0]
        Else
            $WMINT = 1
            $K = 1
            $T = StringLower($MSGID[$J][2])
            While $K <= $MSGQUEUE[0][0]
                If StringLower($MSGQUEUE[$K][0]) = $T Then
                    For $I = $K To $MSGQUEUE[0][0] - 1
                        For $L = 0 To 1
                            $MSGQUEUE[$I][$L] = $MSGQUEUE[$I + 1][$L]
                        Next
                    Next
                    ReDim $MSGQUEUE[$MSGQUEUE[0][0]][2]
                    $MSGQUEUE[0][0] -= 1
                    ContinueLoop
                EndIf
                $K += 1
            WEnd
            If $MSGID[0][0] = 1 Then
                GUIRegisterMsg($MSG_WM_COPYDATA, "")
                _STOP()
            EndIf
            GUIDelete($MSGID[$J][3])
            For $I = $J To $MSGID[0][0] - 1
                For $L = 0 To 5
                    $MSGID[$I][$L] = $MSGID[$I + 1][$L]
                Next
            Next
            ReDim $MSGID[$MSGID[0][0]][6]
            $MSGID[0][0] -= 1
            $ID = 0
            $WMINT = 0
        EndIf
        Return SetError(0, 0, $ID)
    EndFunc
    Func _MSGRELEASE()
        $WMINT = 1
        ReDim $MSGQUEUE[1][2]
        $MSGQUEUE[0][0] = 0
        GUIRegisterMsg($MSG_WM_COPYDATA, "")
        For $I = 1 To $MSGID[0][0]
            GUIDelete($MSGID[$I][3])
        Next
        ReDim $MSGID[1][6]
        $MSGID[0][0] = 0
        _STOP()
        $WMINT = 0
        Return SetError(@error, 0, (Not @error))
    EndFunc
    Func _MSGSEND($SIDENTIFIER, $SMESSAGE)
        Local $HWND, $SENDERR = False, $ARET, $TMESSAGE, $TCOPYDATA
        If (Not IsString($SIDENTIFIER)) Or (Not IsString($SMESSAGE)) Or (StringStripWS($SIDENTIFIER, 8) = "") Then
            Return SetError(1, 0, 0)
        EndIf
        $HWND = _WINHANDLE($SIDENTIFIER & $MSGID[0][5])
        If $HWND = 0 Then
            Return SetError(1, 2, 0)
        EndIf
        $TMESSAGE = DllStructCreate("char[" & StringLen($SMESSAGE) + 1 & "]")
        DllStructSetData($TMESSAGE, 1, $SMESSAGE)
        $TCOPYDATA = DllStructCreate("dword;dword;ptr")
        DllStructSetData($TCOPYDATA, 2, StringLen($SMESSAGE) + 1)
        DllStructSetData($TCOPYDATA, 3, DllStructGetPtr($TMESSAGE))
        $ARET = DllCall("user32.dll", "lparam", "SendMessage", "hwnd", $HWND, "int", $MSG_WM_COPYDATA, "wparam", 0, "lparam", DllStructGetPtr($TCOPYDATA))
        If @error Then
            $SENDERR = 1
        EndIf
        $TCOPYDATA = 0
        $TMESSAGE = 0
        If $SENDERR Then
            Return SetError(1, 0, 0)
        EndIf
        If $ARET[0] = -1 Then
            Return SetError(1, -1, 0)
        EndIf
        Return SetError(0, 0, 1)
    EndFunc
    Func _MSGTIMERINTERVAL($ITIMERINTERVAL)
        If Not IsInt($ITIMERINTERVAL) Then
            Return SetError(1, 0, $MSGID[0][2])
        EndIf
        If $ITIMERINTERVAL = 0 Then
            Return SetError(0, 0, $MSGID[0][2])
        EndIf
        If $ITIMERINTERVAL < 50 Then
            $ITIMERINTERVAL = 50
        EndIf
        _STOP()
        If @error Then
            Return SetError(1, 0, $MSGID[0][2])
        EndIf
        $MSGID[0][2] = $ITIMERINTERVAL
        _START()
        If @error Then
            GUIRegisterMsg($MSG_WM_COPYDATA, "")
            Return SetError(1, 0, $MSGID[0][2])
        EndIf
        Return $MSGID[0][2]
    EndFunc
    Func _MSGWINDOWHANDLE($CONTROLID)
        If Not IsInt($CONTROLID) Then
            Return 0
        EndIf
        For $I = 1 To $MSGID[0][0]
            If $MSGID[$I][0] = $MSGID Then
                Return $MSGID[$I][3]
            EndIf
        Next
        Return 0
    EndFunc
    Func _ISRECEIVER($SIDENTIFIER)
        If (Not IsString($SIDENTIFIER)) Or (_WINHANDLE($SIDENTIFIER & $MSGID[0][5]) = 0) Then
            Return 0
        EndIf
        Return 1
    EndFunc
#endregion Public Functions
#region Internal Functions
    Func _FUNCTION($HWND)
        For $I = 0 To $MSGID[0][0]
            If $MSGID[$I][3] = $HWND Then
                Return $MSGID[$I][2]
            EndIf
        Next
        Return 0
    EndFunc
    Func _MESSAGE($SFUNCTION, $SMESSAGE)
        ReDim $MSGQUEUE[$MSGQUEUE[0][0] + 2][2]
        $MSGQUEUE[$MSGQUEUE[0][0] + 1][0] = $SFUNCTION
        $MSGQUEUE[$MSGQUEUE[0][0] + 1][1] = $SMESSAGE
        $MSGQUEUE[0][0] += 1
    EndFunc
    Func _QUEUE()
        If ($WMINT = 1) Or ($QEINT = 1) Or ($MSGQUEUE[0][0] = 0) Then
            Return
        EndIf
        $QEINT = 1
        Local $RET = Call($MSGQUEUE[1][0], $MSGQUEUE[1][1])
        If (@error = 57005) And (@extended = 48879) Then
        Else
            Local $LENGHT = $MSGQUEUE[0][0] - 1
            Switch $RET
                Case 0
                    For $I = 1 To $LENGHT
                        For $J = 0 To 1
                            $MSGQUEUE[$I][$J] = $MSGQUEUE[$I + 1][$J]
                        Next
                    Next
                    ReDim $MSGQUEUE[$LENGHT + 1][2]
                    $MSGQUEUE[0][0] = $LENGHT
                Case Else
                    If $LENGHT > 1 Then
                        _SWAP(1, 2)
                    EndIf
            EndSwitch
        EndIf
        $QEINT = 0
    EndFunc
    Func _START()
        Local $ARET
        If $MSGID[0][4] = 0 Then
            $ARET = DllCall("user32.dll", "int", "SetTimer", "hwnd", 0, "int", 0, "int", $MSGID[0][2], "ptr", DllCallbackGetPtr($MSGID[0][3]))
            If (@error) Or ($ARET[0] = 0) Then
                Return SetError(1, 0, 0)
            EndIf
            $MSGID[0][4] = $ARET[0]
        EndIf
        Return SetError(0, 0, 1)
    EndFunc
    Func _STOP()
        Local $ARET
        If $MSGID[0][4] > 0 Then
            $ARET = DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "int", $MSGID[0][4])
            If (@error) Or ($ARET[0] = 0) Then
                Return SetError(1, 0, 0)
            EndIf
            $MSGID[0][4] = 0
        EndIf
        Return SetError(0, 0, 1)
    EndFunc
    Func _SWAP($INDEX1, $INDEX2)
        Local $TMP
        For $I = 0 To 1
            $TMP = $MSGQUEUE[$INDEX1][$I]
            $MSGQUEUE[$INDEX1][$I] = $MSGQUEUE[$INDEX2][$I]
            $MSGQUEUE[$INDEX2][$I] = $TMP
        Next
    EndFunc
    Func _WINHANDLE($STITLE)
        Local $WLIST = WinList()
        $STITLE = StringLower($STITLE)
        For $I = 1 To $WLIST[0][0]
            If StringLower($WLIST[$I][0]) = $STITLE Then
                Return $WLIST[$I][1]
            EndIf
        Next
        Return 0
    EndFunc
    Func _WM_COPYDATA($HWND, $MSGID, $WPARAM, $LPARAM)
        If ($WMINT = 1) Then
            Return -1
        EndIf
        Local $FUNCTION = _FUNCTION($HWND)
        If $FUNCTION > "" Then
            Local $TCOPYDATA = DllStructCreate("dword;dword;ptr", $LPARAM)
            Local $TMSG = DllStructCreate("char[" & DllStructGetData($TCOPYDATA, 2) & "]", DllStructGetData($TCOPYDATA, 3))
            _MESSAGE($FUNCTION, DllStructGetData($TMSG, 1))
            Return 0
        EndIf
        Return "GUI_RUNDEFMSG"
    EndFunc
    Func ONMESSAGESEXIT()
        GUIRegisterMsg($MSG_WM_COPYDATA, "")
        _STOP()
        DllCallbackFree($MSGID[0][3])
        Call($ONMESSAGESEXIT)
    EndFunc
#endregion Internal Functions
Global Const $FW_DONTCARE = 0
Global Const $FW_THIN = 100
Global Const $FW_EXTRALIGHT = 200
Global Const $FW_ULTRALIGHT = 200
Global Const $FW_LIGHT = 300
Global Const $FW_NORMAL = 400
Global Const $FW_REGULAR = 400
Global Const $FW_MEDIUM = 500
Global Const $FW_SEMIBOLD = 600
Global Const $FW_DEMIBOLD = 600
Global Const $FW_BOLD = 700
Global Const $FW_EXTRABOLD = 800
Global Const $FW_ULTRABOLD = 800
Global Const $FW_HEAVY = 900
Global Const $FW_BLACK = 900
Global Const $CF_EFFECTS = 256
Global Const $CF_PRINTERFONTS = 2
Global Const $CF_SCREENFONTS = 1
Global Const $CF_NOSCRIPTSEL = 8388608
Global Const $CF_INITTOLOGFONTSTRUCT = 64
Global Const $LOGPIXELSX = 88
Global Const $LOGPIXELSY = 90
Global Const $ANSI_CHARSET = 0
Global Const $BALTIC_CHARSET = 186
Global Const $CHINESEBIG5_CHARSET = 136
Global Const $DEFAULT_CHARSET = 1
Global Const $EASTEUROPE_CHARSET = 238
Global Const $GB2312_CHARSET = 134
Global Const $GREEK_CHARSET = 161
Global Const $HANGEUL_CHARSET = 129
Global Const $MAC_CHARSET = 77
Global Const $OEM_CHARSET = 255
Global Const $RUSSIAN_CHARSET = 204
Global Const $SHIFTJIS_CHARSET = 128
Global Const $SYMBOL_CHARSET = 2
Global Const $TURKISH_CHARSET = 162
Global Const $VIETNAMESE_CHARSET = 163
Global Const $OUT_CHARACTER_PRECIS = 2
Global Const $OUT_DEFAULT_PRECIS = 0
Global Const $OUT_DEVICE_PRECIS = 5
Global Const $OUT_OUTLINE_PRECIS = 8
Global Const $OUT_PS_ONLY_PRECIS = 10
Global Const $OUT_RASTER_PRECIS = 6
Global Const $OUT_STRING_PRECIS = 1
Global Const $OUT_STROKE_PRECIS = 3
Global Const $OUT_TT_ONLY_PRECIS = 7
Global Const $OUT_TT_PRECIS = 4
Global Const $CLIP_CHARACTER_PRECIS = 1
Global Const $CLIP_DEFAULT_PRECIS = 0
Global Const $CLIP_EMBEDDED = 128
Global Const $CLIP_LH_ANGLES = 16
Global Const $CLIP_MASK = 15
Global Const $CLIP_STROKE_PRECIS = 2
Global Const $CLIP_TT_ALWAYS = 32
Global Const $ANTIALIASED_QUALITY = 4
Global Const $DEFAULT_QUALITY = 0
Global Const $DRAFT_QUALITY = 1
Global Const $NONANTIALIASED_QUALITY = 3
Global Const $PROOF_QUALITY = 2
Global Const $DEFAULT_PITCH = 0
Global Const $FIXED_PITCH = 1
Global Const $VARIABLE_PITCH = 2
Global Const $FF_DECORATIVE = 80
Global Const $FF_DONTCARE = 0
Global Const $FF_MODERN = 48
Global Const $FF_ROMAN = 16
Global Const $FF_SCRIPT = 64
Global Const $FF_SWISS = 32
Global Const $TAGPOINT = "long X;long Y"
Global Const $TAGRECT = "long Left;long Top;long Right;long Bottom"
Global Const $TAGSIZE = "long X;long Y"
Global Const $TAGMARGINS = "int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight"
Global Const $TAGFILETIME = "dword Lo;dword Hi"
Global Const $TAGSYSTEMTIME = "word Year;word Month;word Dow;word Day;word Hour;word Minute;word Second;word MSeconds"
Global Const $TAGTIME_ZONE_INFORMATION = "long Bias;wchar StdName[32];word StdDate[8];long StdBias;wchar DayName[32];word DayDate[8];long DayBias"
Global Const $TAGNMHDR = "hwnd hWndFrom;uint_ptr IDFrom;INT Code"
Global Const $TAGCOMBOBOXEXITEM = "uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;int SelectedImage;int OverlayImage;" & "int Indent;lparam Param"
Global Const $TAGNMCBEDRAGBEGIN = $TAGNMHDR & ";int ItemID;ptr szText"
Global Const $TAGNMCBEENDEDIT = $TAGNMHDR & ";bool fChanged;int NewSelection;ptr szText;int Why"
Global Const $TAGNMCOMBOBOXEX = $TAGNMHDR & ";uint Mask;int_ptr Item;ptr Text;int TextMax;int Image;" & "int SelectedImage;int OverlayImage;int Indent;lparam Param"
Global Const $TAGDTPRANGE = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;" & "word MinSecond;word MinMSecond;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;" & "word MaxMinute;word MaxSecond;word MaxMSecond;bool MinValid;bool MaxValid"
Global Const $TAGNMDATETIMECHANGE = $TAGNMHDR & ";dword Flag;" & $TAGSYSTEMTIME
Global Const $TAGNMDATETIMEFORMAT = $TAGNMHDR & ";ptr Format;" & $TAGSYSTEMTIME & ";ptr pDisplay;wchar Display[64]"
Global Const $TAGNMDATETIMEFORMATQUERY = $TAGNMHDR & ";ptr Format;long SizeX;long SizeY"
Global Const $TAGNMDATETIMEKEYDOWN = $TAGNMHDR & ";int VirtKey;ptr Format;" & $TAGSYSTEMTIME
Global Const $TAGNMDATETIMESTRING = $TAGNMHDR & ";ptr UserString;" & $TAGSYSTEMTIME & ";dword Flags"
Global Const $TAGEVENTLOGRECORD = "dword Length;dword Reserved;dword RecordNumber;dword TimeGenerated;dword TimeWritten;dword EventID;" & "word EventType;word NumStrings;word EventCategory;word ReservedFlags;dword ClosingRecordNumber;dword StringOffset;" & "dword UserSidLength;dword UserSidOffset;dword DataLength;dword DataOffset"
Global Const $TAGGDIPBITMAPDATA = "uint Width;uint Height;int Stride;int Format;ptr Scan0;uint_ptr Reserved"
Global Const $TAGGDIPENCODERPARAM = "byte GUID[16];dword Count;dword Type;ptr Values"
Global Const $TAGGDIPENCODERPARAMS = "dword Count;byte Params[0]"
Global Const $TAGGDIPRECTF = "float X;float Y;float Width;float Height"
Global Const $TAGGDIPSTARTUPINPUT = "uint Version;ptr Callback;bool NoThread;bool NoCodecs"
Global Const $TAGGDIPSTARTUPOUTPUT = "ptr HookProc;ptr UnhookProc"
Global Const $TAGGDIPIMAGECODECINFO = "byte CLSID[16];byte FormatID[16];ptr CodecName;ptr DllName;ptr FormatDesc;ptr FileExt;" & "ptr MimeType;dword Flags;dword Version;dword SigCount;dword SigSize;ptr SigPattern;ptr SigMask"
Global Const $TAGGDIPPENCODERPARAMS = "dword Count;byte Params[0]"
Global Const $TAGHDITEM = "uint Mask;int XY;ptr Text;handle hBMP;int TextMax;int Fmt;lparam Param;int Image;int Order;uint Type;ptr pFilter;uint State"
Global Const $TAGNMHDDISPINFO = $TAGNMHDR & ";int Item;uint Mask;ptr Text;int TextMax;int Image;lparam lParam"
Global Const $TAGNMHDFILTERBTNCLICK = $TAGNMHDR & ";int Item;" & $TAGRECT
Global Const $TAGNMHEADER = $TAGNMHDR & ";int Item;int Button;ptr pItem"
Global Const $TAGGETIPADDRESS = "byte Field4;byte Field3;byte Field2;byte Field1"
Global Const $TAGNMIPADDRESS = $TAGNMHDR & ";int Field;int Value"
Global Const $TAGLVFINDINFO = "uint Flags;ptr Text;lparam Param;" & $TAGPOINT & ";uint Direction"
Global Const $TAGLVHITTESTINFO = $TAGPOINT & ";uint Flags;int Item;int SubItem"
Global Const $TAGLVITEM = "uint Mask;int Item;int SubItem;uint State;uint StateMask;ptr Text;int TextMax;int Image;lparam Param;" & "int Indent;int GroupID;uint Columns;ptr pColumns"
Global Const $TAGNMLISTVIEW = $TAGNMHDR & ";int Item;int SubItem;uint NewState;uint OldState;uint Changed;" & "long ActionX;long ActionY;lparam Param"
Global Const $TAGNMLVCUSTOMDRAW = $TAGNMHDR & ";dword dwDrawStage;handle hdc;long Left;long Top;long Right;long Bottom;" & "dword_ptr dwItemSpec;uint uItemState;lparam lItemlParam" & ";dword clrText;dword clrTextBk;int iSubItem;dword dwItemType;dword clrFace;int iIconEffect;" & "int iIconPhase;int iPartId;int iStateId;long TextLeft;long TextTop;long TextRight;long TextBottom;uint uAlign"
Global Const $TAGNMLVDISPINFO = $TAGNMHDR & ";" & $TAGLVITEM
Global Const $TAGNMLVFINDITEM = $TAGNMHDR & ";" & $TAGLVFINDINFO
Global Const $TAGNMLVGETINFOTIP = $TAGNMHDR & ";dword Flags;ptr Text;int TextMax;int Item;int SubItem;lparam lParam"
Global Const $TAGNMITEMACTIVATE = $TAGNMHDR & ";int Index;int SubItem;uint NewState;uint OldState;uint Changed;" & $TAGPOINT & ";lparam lParam;uint KeyFlags"
Global Const $TAGNMLVKEYDOWN = $TAGNMHDR & ";align 1;word VKey;uint Flags"
Global Const $TAGNMLVSCROLL = $TAGNMHDR & ";int DX;int DY"
Global Const $TAGMCHITTESTINFO = "uint Size;" & $TAGPOINT & ";uint Hit;" & $TAGSYSTEMTIME
Global Const $TAGMCMONTHRANGE = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;" & "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;" & "word MaxMSeconds;short Span"
Global Const $TAGMCRANGE = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;" & "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;" & "word MaxMSeconds;short MinSet;short MaxSet"
Global Const $TAGMCSELRANGE = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;" & "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;" & "word MaxMSeconds"
Global Const $TAGNMDAYSTATE = $TAGNMHDR & ";" & $TAGSYSTEMTIME & ";int DayState;ptr pDayState"
Global Const $TAGNMSELCHANGE = $TAGNMHDR & ";word BegYear;word BegMonth;word BegDOW;word BegDay;" & "word BegHour;word BegMinute;word BegSecond;word BegMSeconds;word EndYear;word EndMonth;word EndDOW;" & "word EndDay;word EndHour;word EndMinute;word EndSecond;word EndMSeconds"
Global Const $TAGNMOBJECTNOTIFY = $TAGNMHDR & ";int Item;ptr piid;ptr pObject;long Result"
Global Const $TAGNMTCKEYDOWN = $TAGNMHDR & ";word VKey;uint Flags"
Global Const $TAGTVITEM = "uint Mask;handle hItem;uint State;uint StateMask;ptr Text;int TextMax;int Image;int SelectedImage;" & "int Children;lparam Param"
Global Const $TAGTVITEMEX = $TAGTVITEM & ";int Integral"
Global Const $TAGNMTREEVIEW = $TAGNMHDR & ";uint Action;uint OldMask;handle OldhItem;uint OldState;uint OldStateMask;" & "ptr OldText;int OldTextMax;int OldImage;int OldSelectedImage;int OldChildren;lparam OldParam;uint NewMask;handle NewhItem;" & "uint NewState;uint NewStateMask;ptr NewText;int NewTextMax;int NewImage;int NewSelectedImage;int NewChildren;" & "lparam NewParam;long PointX;long PointY"
Global Const $TAGNMTVCUSTOMDRAW = $TAGNMHDR & ";dword DrawStage;handle HDC;long Left;long Top;long Right;long Bottom;" & "dword_ptr ItemSpec;uint ItemState;lparam ItemParam;dword ClrText;dword ClrTextBk;int Level"
Global Const $TAGNMTVDISPINFO = $TAGNMHDR & ";" & $TAGTVITEM
Global Const $TAGNMTVGETINFOTIP = $TAGNMHDR & ";ptr Text;int TextMax;handle hItem;lparam lParam"
Global Const $TAGTVHITTESTINFO = $TAGPOINT & ";uint Flags;handle Item"
Global Const $TAGNMTVKEYDOWN = $TAGNMHDR & ";word VKey;uint Flags"
Global Const $TAGNMMOUSE = $TAGNMHDR & ";dword_ptr ItemSpec;dword_ptr ItemData;" & $TAGPOINT & ";lparam HitInfo"
Global Const $TAGTOKEN_PRIVILEGES = "dword Count;int64 LUID;dword Attributes"
Global Const $TAGIMAGEINFO = "handle hBitmap;handle hMask;int Unused1;int Unused2;" & $TAGRECT
Global Const $TAGMENUINFO = "dword Size;INT Mask;dword Style;uint YMax;handle hBack;dword ContextHelpID;ulong_ptr MenuData"
Global Const $TAGMENUITEMINFO = "uint Size;uint Mask;uint Type;uint State;uint ID;handle SubMenu;handle BmpChecked;handle BmpUnchecked;" & "ulong_ptr ItemData;ptr TypeData;uint CCH;handle BmpItem"
Global Const $TAGREBARBANDINFO = "uint cbSize;uint fMask;uint fStyle;dword clrFore;dword clrBack;ptr lpText;uint cch;" & "int iImage;hwnd hwndChild;uint cxMinChild;uint cyMinChild;uint cx;handle hbmBack;uint wID;uint cyChild;uint cyMaxChild;" & "uint cyIntegral;uint cxIdeal;lparam lParam;uint cxHeader"
Global Const $TAGNMREBARAUTOBREAK = $TAGNMHDR & ";uint uBand;uint wID;lparam lParam;uint uMsg;uint fStyleCurrent;bool fAutoBreak"
Global Const $TAGNMRBAUTOSIZE = $TAGNMHDR & ";bool fChanged;long TargetLeft;long TargetTop;long TargetRight;long TargetBottom;" & "long ActualLeft;long ActualTop;long ActualRight;long ActualBottom"
Global Const $TAGNMREBAR = $TAGNMHDR & ";dword dwMask;uint uBand;uint fStyle;uint wID;laram lParam"
Global Const $TAGNMREBARCHEVRON = $TAGNMHDR & ";uint uBand;uint wID;lparam lParam;" & $TAGRECT & ";lparam lParamNM"
Global Const $TAGNMREBARCHILDSIZE = $TAGNMHDR & ";uint uBand;uint wID;long CLeft;long CTop;long CRight;long CBottom;" & "long BLeft;long BTop;long BRight;long BBottom"
Global Const $TAGCOLORSCHEME = "dword Size;dword BtnHighlight;dword BtnShadow"
Global Const $TAGNMTOOLBAR = $TAGNMHDR & ";int iItem;" & "int iBitmap;int idCommand;byte fsState;byte fsStyle;align;dword_ptr dwData;int_ptr iString" & ";int cchText;ptr pszText;" & $TAGRECT
Global Const $TAGNMTBHOTITEM = $TAGNMHDR & ";int idOld;int idNew;dword dwFlags"
Global Const $TAGTBBUTTON = "int Bitmap;int Command;byte State;byte Style;align;dword_ptr Param;int_ptr String"
Global Const $TAGTBBUTTONINFO = "uint Size;dword Mask;int Command;int Image;byte State;byte Style;word CX;dword_ptr Param;ptr Text;int TextMax"
Global Const $TAGNETRESOURCE = "dword Scope;dword Type;dword DisplayType;dword Usage;ptr LocalName;ptr RemoteName;ptr Comment;ptr Provider"
Global Const $TAGOVERLAPPED = "ulong_ptr Internal;ulong_ptr InternalHigh;dword Offset;dword OffsetHigh;handle hEvent"
Global Const $TAGOPENFILENAME = "dword StructSize;hwnd hwndOwner;handle hInstance;ptr lpstrFilter;ptr lpstrCustomFilter;" & "dword nMaxCustFilter;dword nFilterIndex;ptr lpstrFile;dword nMaxFile;ptr lpstrFileTitle;dword nMaxFileTitle;" & "ptr lpstrInitialDir;ptr lpstrTitle;dword Flags;word nFileOffset;word nFileExtension;ptr lpstrDefExt;lparam lCustData;" & "ptr lpfnHook;ptr lpTemplateName;ptr pvReserved;dword dwReserved;dword FlagsEx"
Global Const $TAGBITMAPINFO = "dword Size;long Width;long Height;word Planes;word BitCount;dword Compression;dword SizeImage;" & "long XPelsPerMeter;long YPelsPerMeter;dword ClrUsed;dword ClrImportant;dword RGBQuad"
Global Const $TAGBLENDFUNCTION = "byte Op;byte Flags;byte Alpha;byte Format"
Global Const $TAGGUID = "dword Data1;word Data2;word Data3;byte Data4[8]"
Global Const $TAGWINDOWPLACEMENT = "uint length; uint flags;uint showCmd;long ptMinPosition[2];long ptMaxPosition[2];long rcNormalPosition[4]"
Global Const $TAGWINDOWPOS = "hwnd hWnd;hwnd InsertAfter;int X;int Y;int CX;int CY;uint Flags"
Global Const $TAGSCROLLINFO = "uint cbSize;uint fMask;int  nMin;int  nMax;uint nPage;int  nPos;int  nTrackPos"
Global Const $TAGSCROLLBARINFO = "dword cbSize;" & $TAGRECT & ";int dxyLineButton;int xyThumbTop;" & "int xyThumbBottom;int reserved;dword rgstate[6]"
Global Const $TAGLOGFONT = "long Height;long Width;long Escapement;long Orientation;long Weight;byte Italic;byte Underline;" & "byte Strikeout;byte CharSet;byte OutPrecision;byte ClipPrecision;byte Quality;byte PitchAndFamily;wchar FaceName[32]"
Global Const $TAGKBDLLHOOKSTRUCT = "dword vkCode;dword scanCode;dword flags;dword time;ulong_ptr dwExtraInfo"
Global Const $TAGPROCESS_INFORMATION = "handle hProcess;handle hThread;dword ProcessID;dword ThreadID"
Global Const $TAGSTARTUPINFO = "dword Size;ptr Reserved1;ptr Desktop;ptr Title;dword X;dword Y;dword XSize;dword YSize;dword XCountChars;" & "dword YCountChars;dword FillAttribute;dword Flags;word ShowWindow;word Reserved2;ptr Reserved3;handle StdInput;" & "handle StdOutput;handle StdError"
Global Const $TAGSECURITY_ATTRIBUTES = "dword Length;ptr Descriptor;bool InheritHandle"
Global Const $TAGWIN32_FIND_DATA = "dword dwFileAttributes; dword ftCreationTime[2]; dword ftLastAccessTime[2]; dword ftLastWriteTime[2]; dword nFileSizeHigh; dword nFileSizeLow; dword dwReserved0; dword dwReserved1; wchar cFileName[260]; wchar cAlternateFileName[14]"
Func _WinAPI_GetLastError($CURERR = @error, $CUREXT = @extended)
    Local $ARESULT = DllCall("kernel32.dll", "dword", "GetLastError")
    Return SetError($CURERR, $CUREXT, $ARESULT[0])
EndFunc
Func _WinAPI_SetLastError($IERRCODE, $CURERR = @error, $CUREXT = @extended)
    DllCall("kernel32.dll", "none", "SetLastError", "dword", $IERRCODE)
    Return SetError($CURERR, $CUREXT)
EndFunc
Global Const $__MISCCONSTANT_CC_ANYCOLOR = 256
Global Const $__MISCCONSTANT_CC_FULLOPEN = 2
Global Const $__MISCCONSTANT_CC_RGBINIT = 1
Global Const $TAGCHOOSECOLOR = "dword Size;hwnd hWndOwnder;handle hInstance;dword rgbResult;ptr CustColors;dword Flags;lparam lCustData;" & "ptr lpfnHook;ptr lpTemplateName"
Global Const $TAGCHOOSEFONT = "dword Size;hwnd hWndOwner;handle hDC;ptr LogFont;int PointSize;dword Flags;dword rgbColors;lparam CustData;" & "ptr fnHook;ptr TemplateName;handle hInstance;ptr szStyle;word FontType;int SizeMin;int SizeMax"
Func _ChooseColor($IRETURNTYPE = 0, $ICOLORREF = 0, $IREFTYPE = 0, $HWNDOWNDER = 0)
    Local $CUSTCOLORS = "dword[16]"
    Local $TCHOOSE = DllStructCreate($TAGCHOOSECOLOR)
    Local $TCC = DllStructCreate($CUSTCOLORS)
    If $IREFTYPE = 1 Then
        $ICOLORREF = Int($ICOLORREF)
    ElseIf $IREFTYPE = 2 Then
        $ICOLORREF = Hex(String($ICOLORREF), 6)
        $ICOLORREF = "0x" & StringMid($ICOLORREF, 5, 2) & StringMid($ICOLORREF, 3, 2) & StringMid($ICOLORREF, 1, 2)
    EndIf
    DllStructSetData($TCHOOSE, "Size", DllStructGetSize($TCHOOSE))
    DllStructSetData($TCHOOSE, "hWndOwnder", $HWNDOWNDER)
    DllStructSetData($TCHOOSE, "rgbResult", $ICOLORREF)
    DllStructSetData($TCHOOSE, "CustColors", DllStructGetPtr($TCC))
    DllStructSetData($TCHOOSE, "Flags", BitOR($__MISCCONSTANT_CC_ANYCOLOR, $__MISCCONSTANT_CC_FULLOPEN, $__MISCCONSTANT_CC_RGBINIT))
    Local $ARESULT = DllCall("comdlg32.dll", "bool", "ChooseColor", "ptr", DllStructGetPtr($TCHOOSE))
    If @error Then Return SetError(@error, @extended, -1)
    If $ARESULT[0] = 0 Then Return SetError(-3, -3, -1)
    Local $COLOR_PICKED = DllStructGetData($TCHOOSE, "rgbResult")
    If $IRETURNTYPE = 1 Then
        Return "0x" & Hex(String($COLOR_PICKED), 6)
    ElseIf $IRETURNTYPE = 2 Then
        $COLOR_PICKED = Hex(String($COLOR_PICKED), 6)
        Return "0x" & StringMid($COLOR_PICKED, 5, 2) & StringMid($COLOR_PICKED, 3, 2) & StringMid($COLOR_PICKED, 1, 2)
    ElseIf $IRETURNTYPE = 0 Then
        Return $COLOR_PICKED
    Else
        Return SetError(-4, -4, -1)
    EndIf
EndFunc
Func _ChooseFont($SFONTNAME = "Courier New", $IPOINTSIZE = 10, $ICOLORREF = 0, $IFONTWEIGHT = 0, $IITALIC = False, $IUNDERLINE = False, $ISTRIKETHRU = False, $HWNDOWNER = 0)
    Local $ITALIC = 0, $UNDERLINE = 0, $STRIKEOUT = 0
    Local $LNGDC = __MISC_GETDC(0)
    Local $LFHEIGHT = Round(($IPOINTSIZE * __MISC_GETDEVICECAPS($LNGDC, $LOGPIXELSX)) / 72, 0)
    __MISC_RELEASEDC(0, $LNGDC)
    Local $TCHOOSEFONT = DllStructCreate($TAGCHOOSEFONT)
    Local $TLOGFONT = DllStructCreate($TAGLOGFONT)
    DllStructSetData($TCHOOSEFONT, "Size", DllStructGetSize($TCHOOSEFONT))
    DllStructSetData($TCHOOSEFONT, "hWndOwner", $HWNDOWNER)
    DllStructSetData($TCHOOSEFONT, "LogFont", DllStructGetPtr($TLOGFONT))
    DllStructSetData($TCHOOSEFONT, "PointSize", $IPOINTSIZE)
    DllStructSetData($TCHOOSEFONT, "Flags", BitOR($CF_SCREENFONTS, $CF_PRINTERFONTS, $CF_EFFECTS, $CF_INITTOLOGFONTSTRUCT, $CF_NOSCRIPTSEL))
    DllStructSetData($TCHOOSEFONT, "rgbColors", $ICOLORREF)
    DllStructSetData($TCHOOSEFONT, "FontType", 0)
    DllStructSetData($TLOGFONT, "Height", $LFHEIGHT)
    DllStructSetData($TLOGFONT, "Weight", $IFONTWEIGHT)
    DllStructSetData($TLOGFONT, "Italic", $IITALIC)
    DllStructSetData($TLOGFONT, "Underline", $IUNDERLINE)
    DllStructSetData($TLOGFONT, "Strikeout", $ISTRIKETHRU)
    DllStructSetData($TLOGFONT, "FaceName", $SFONTNAME)
    Local $ARESULT = DllCall("comdlg32.dll", "bool", "ChooseFontW", "ptr", DllStructGetPtr($TCHOOSEFONT))
    If @error Then Return SetError(@error, @extended, -1)
    If $ARESULT[0] = 0 Then Return SetError(-3, -3, -1)
    Local $FONTNAME = DllStructGetData($TLOGFONT, "FaceName")
    If StringLen($FONTNAME) = 0 And StringLen($SFONTNAME) > 0 Then $FONTNAME = $SFONTNAME
    If DllStructGetData($TLOGFONT, "Italic") Then $ITALIC = 2
    If DllStructGetData($TLOGFONT, "Underline") Then $UNDERLINE = 4
    If DllStructGetData($TLOGFONT, "Strikeout") Then $STRIKEOUT = 8
    Local $ATTRIBUTES = BitOR($ITALIC, $UNDERLINE, $STRIKEOUT)
    Local $SIZE = DllStructGetData($TCHOOSEFONT, "PointSize") / 10
    Local $COLORREF = DllStructGetData($TCHOOSEFONT, "rgbColors")
    Local $WEIGHT = DllStructGetData($TLOGFONT, "Weight")
    Local $COLOR_PICKED = Hex(String($COLORREF), 6)
    Return StringSplit($ATTRIBUTES & "," & $FONTNAME & "," & $SIZE & "," & $WEIGHT & "," & $COLORREF & "," & "0x" & $COLOR_PICKED & "," & "0x" & StringMid($COLOR_PICKED, 5, 2) & StringMid($COLOR_PICKED, 3, 2) & StringMid($COLOR_PICKED, 1, 2), ",")
EndFunc
Func _ClipPutFile($SFILE, $SSEPARATOR = "|")
    Local Const $GMEM_MOVEABLE = 2, $CF_HDROP = 15
    $SFILE &= $SSEPARATOR & $SSEPARATOR
    Local $NGLOBMEMSIZE = (StringLen($SFILE) + 20)
    Local $ARESULT = DllCall("user32.dll", "bool", "OpenClipboard", "hwnd", 0)
    If @error Or $ARESULT[0] = 0 Then Return SetError(1, _WinAPI_GetLastError(), False)
    Local $IERROR = 0, $ILASTERROR = 0
    $ARESULT = DllCall("user32.dll", "bool", "EmptyClipboard")
    If @error Or Not $ARESULT[0] Then
        $IERROR = 2
        $ILASTERROR = _WinAPI_GetLastError()
    Else
        $ARESULT = DllCall("kernel32.dll", "handle", "GlobalAlloc", "uint", $GMEM_MOVEABLE, "ulong_ptr", $NGLOBMEMSIZE)
        If @error Or Not $ARESULT[0] Then
            $IERROR = 3
            $ILASTERROR = _WinAPI_GetLastError()
        Else
            Local $HGLOBAL = $ARESULT[0]
            $ARESULT = DllCall("kernel32.dll", "ptr", "GlobalLock", "handle", $HGLOBAL)
            If @error Or Not $ARESULT[0] Then
                $IERROR = 4
                $ILASTERROR = _WinAPI_GetLastError()
            Else
                Local $HLOCK = $ARESULT[0]
                Local $DROPFILES = DllStructCreate("dword;ptr;int;int;int;char[" & StringLen($SFILE) + 1 & "]", $HLOCK)
                If @error Then Return SetError(5, 6, False)
                Local $TEMPSTRUCT = DllStructCreate("dword;ptr;int;int;int")
                DllStructSetData($DROPFILES, 1, DllStructGetSize($TEMPSTRUCT))
                DllStructSetData($DROPFILES, 2, 0)
                DllStructSetData($DROPFILES, 3, 0)
                DllStructSetData($DROPFILES, 4, 0)
                DllStructSetData($DROPFILES, 5, 0)
                DllStructSetData($DROPFILES, 6, $SFILE)
                For $I = 1 To StringLen($SFILE)
                    If DllStructGetData($DROPFILES, 6, $I) = $SSEPARATOR Then DllStructSetData($DROPFILES, 6, Chr(0), $I)
                Next
                $ARESULT = DllCall("user32.dll", "handle", "SetClipboardData", "uint", $CF_HDROP, "handle", $HGLOBAL)
                If @error Or Not $ARESULT[0] Then
                    $IERROR = 6
                    $ILASTERROR = _WinAPI_GetLastError()
                EndIf
                $ARESULT = DllCall("kernel32.dll", "bool", "GlobalUnlock", "handle", $HGLOBAL)
                If (@error Or Not $ARESULT[0]) And Not $IERROR And _WinAPI_GetLastError() Then
                    $IERROR = 8
                    $ILASTERROR = _WinAPI_GetLastError()
                EndIf
            EndIf
            $ARESULT = DllCall("kernel32.dll", "ptr", "GlobalFree", "handle", $HGLOBAL)
            If (@error Or Not $ARESULT[0]) And Not $IERROR Then
                $IERROR = 9
                $ILASTERROR = _WinAPI_GetLastError()
            EndIf
        EndIf
    EndIf
    $ARESULT = DllCall("user32.dll", "bool", "CloseClipboard")
    If (@error Or Not $ARESULT[0]) And Not $IERROR Then Return SetError(7, _WinAPI_GetLastError(), False)
    If $IERROR Then Return SetError($IERROR, $ILASTERROR, False)
    Return True
EndFunc
Func _Iif($FTEST, $VTRUEVAL, $VFALSEVAL)
    If $FTEST Then
        Return $VTRUEVAL
    Else
        Return $VFALSEVAL
    EndIf
EndFunc
Func _MouseTrap($ILEFT = 0, $ITOP = 0, $IRIGHT = 0, $IBOTTOM = 0)
    Local $ARESULT
    If @NumParams == 0 Then
        $ARESULT = DllCall("user32.dll", "bool", "ClipCursor", "ptr", 0)
        If @error Or Not $ARESULT[0] Then Return SetError(1, _WinAPI_GetLastError(), False)
    Else
        If @NumParams == 2 Then
            $IRIGHT = $ILEFT + 1
            $IBOTTOM = $ITOP + 1
        EndIf
        Local $TRECT = DllStructCreate($TAGRECT)
        DllStructSetData($TRECT, "Left", $ILEFT)
        DllStructSetData($TRECT, "Top", $ITOP)
        DllStructSetData($TRECT, "Right", $IRIGHT)
        DllStructSetData($TRECT, "Bottom", $IBOTTOM)
        $ARESULT = DllCall("user32.dll", "bool", "ClipCursor", "ptr", DllStructGetPtr($TRECT))
        If @error Or Not $ARESULT[0] Then Return SetError(2, _WinAPI_GetLastError(), False)
    EndIf
    Return True
EndFunc
Func _Singleton($SOCCURENCENAME, $IFLAG = 0)
    Local Const $ERROR_ALREADY_EXISTS = 183
    Local Const $SECURITY_DESCRIPTOR_REVISION = 1
    Local $PSECURITYATTRIBUTES = 0
    If BitAND($IFLAG, 2) Then
        Local $TSECURITYDESCRIPTOR = DllStructCreate("dword[5]")
        Local $PSECURITYDESCRIPTOR = DllStructGetPtr($TSECURITYDESCRIPTOR)
        Local $ARET = DllCall("advapi32.dll", "bool", "InitializeSecurityDescriptor", "ptr", $PSECURITYDESCRIPTOR, "dword", $SECURITY_DESCRIPTOR_REVISION)
        If @error Then Return SetError(@error, @extended, 0)
        If $ARET[0] Then
            $ARET = DllCall("advapi32.dll", "bool", "SetSecurityDescriptorDacl", "ptr", $PSECURITYDESCRIPTOR, "bool", 1, "ptr", 0, "bool", 0)
            If @error Then Return SetError(@error, @extended, 0)
            If $ARET[0] Then
                Local $STRUCTSECURITYATTRIBUTES = DllStructCreate($TAGSECURITY_ATTRIBUTES)
                DllStructSetData($STRUCTSECURITYATTRIBUTES, 1, DllStructGetSize($STRUCTSECURITYATTRIBUTES))
                DllStructSetData($STRUCTSECURITYATTRIBUTES, 2, $PSECURITYDESCRIPTOR)
                DllStructSetData($STRUCTSECURITYATTRIBUTES, 3, 0)
                $PSECURITYATTRIBUTES = DllStructGetPtr($STRUCTSECURITYATTRIBUTES)
            EndIf
        EndIf
    EndIf
    Local $HANDLE = DllCall("kernel32.dll", "handle", "CreateMutexW", "ptr", $PSECURITYATTRIBUTES, "bool", 1, "wstr", $SOCCURENCENAME)
    If @error Then Return SetError(@error, @extended, 0)
    Local $LASTERROR = DllCall("kernel32.dll", "dword", "GetLastError")
    If @error Then Return SetError(@error, @extended, 0)
    If $LASTERROR[0] = $ERROR_ALREADY_EXISTS Then
        If BitAND($IFLAG, 1) Then
            Return SetError($LASTERROR[0], $LASTERROR[0], 0)
        Else
            Exit -1
        EndIf
    EndIf
    Return $HANDLE[0]
EndFunc
Func _IsPressed($SHEXKEY, $VDLL = "user32.dll")
    Local $A_R = DllCall($VDLL, "short", "GetAsyncKeyState", "int", "0x" & $SHEXKEY)
    If @error Then Return SetError(@error, @extended, False)
    Return BitAND($A_R[0], 32768) <> 0
EndFunc
Func _VersionCompare($SVERSION1, $SVERSION2)
    If $SVERSION1 = $SVERSION2 Then Return 0
    Local $SEP = "."
    If StringInStr($SVERSION1, $SEP) = 0 Then $SEP = ","
    Local $AVERSION1 = StringSplit($SVERSION1, $SEP)
    Local $AVERSION2 = StringSplit($SVERSION2, $SEP)
    If UBound($AVERSION1) <> UBound($AVERSION2) Or UBound($AVERSION1) = 0 Then
        SetExtended(1)
        If $SVERSION1 > $SVERSION2 Then
            Return 1
        ElseIf $SVERSION1 < $SVERSION2 Then
            Return -1
        EndIf
    Else
        For $I = 1 To UBound($AVERSION1) - 1
            If StringIsDigit($AVERSION1[$I]) And StringIsDigit($AVERSION2[$I]) Then
                If Number($AVERSION1[$I]) > Number($AVERSION2[$I]) Then
                    Return 1
                ElseIf Number($AVERSION1[$I]) < Number($AVERSION2[$I]) Then
                    Return -1
                EndIf
            Else
                SetExtended(1)
                If $AVERSION1[$I] > $AVERSION2[$I] Then
                    Return 1
                ElseIf $AVERSION1[$I] < $AVERSION2[$I] Then
                    Return -1
                EndIf
            EndIf
        Next
    EndIf
    Return SetError(2, 0, 0)
EndFunc
Func __MISC_GETDC($HWND)
    Local $ARESULT = DllCall("User32.dll", "handle", "GetDC", "hwnd", $HWND)
    If @error Or Not $ARESULT[0] Then Return SetError(1, _WinAPI_GetLastError(), 0)
    Return $ARESULT[0]
EndFunc
Func __MISC_GETDEVICECAPS($HDC, $IINDEX)
    Local $ARESULT = DllCall("GDI32.dll", "int", "GetDeviceCaps", "handle", $HDC, "int", $IINDEX)
    If @error Then Return SetError(@error, @extended, 0)
    Return $ARESULT[0]
EndFunc
Func __MISC_RELEASEDC($HWND, $HDC)
    Local $ARESULT = DllCall("User32.dll", "int", "ReleaseDC", "hwnd", $HWND, "handle", $HDC)
    If @error Then Return SetError(@error, @extended, False)
    Return $ARESULT[0] <> 0
EndFunc
Global $PING = TimerInit(), $ERROR
If $CMDLINE[0] = 1 And $CMDLINE[1] = "CameraRAWCloser" Then
    Opt("TrayIconHide", 1)
    TraySetToolTip("CameraRAWCloser")
    GUICreate("", 1, 1)
    If _ISRECEIVER("CameraRAWCloser") Then Exit
    _MSGREGISTER("CameraRAWCloser", "_Receiver")
    Local $TR, $TIM = TimerInit()
    While 1
        $H = WinGetHandle("[CLASS:CameraRaw_WindowClass]")
        If Not ($H = "") And Not (WinActivate($H) = 0) Then ControlSend($H, "", "", "^o")
        $H = WinGetHandle("[TITLE:Adobe Photoshop CS; CLASS:#32770]", " is not currently available.")
        If Not ($H = "") Then ControlSend($H, "", "", "!c")
        $H = WinGetHandle("[TITLE:Adobe Photoshop CS; CLASS:#32770]", "&Serial Number:")
        If Not ($H = "") Then
            ControlClick($H, "", "Button10")
            ControlClick($H, "", "Button15")
        EndIf
        If TimerDiff($PING) > 600000 Then Exit
        If TimerDiff($TIM) > 10000 Then
            If Not (_Singleton("PhotoShop Automate", 1) = 0) Then Exit
            $TIM = TimerInit()
        EndIf
        Sleep(200)
    WEnd
EndIf
TraySetToolTip("PhotoAutomate")
_Singleton("PhotoShop Automate")
If @Compiled Then
    ShellExecute(@ScriptFullPath, "CameraRAWCloser")
Else
    If Not FileExists(@ProgramFilesDir & "\AutoIt3\AutoIt3.exe") Then Exit
    ShellExecute(@ProgramFilesDir & "\AutoIt3\AutoIt3.exe", '"' & @ScriptFullPath & '"' & " CameraRAWCloser")
EndIf
AdlibRegister("_ping", 5000)
OnAutoItExitRegister("_exit")
Func _ArrayAdd(ByRef $AVARRAY, $VVALUE)
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, -1)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(2, 0, -1)
    Local $IUBOUND = UBound($AVARRAY)
    ReDim $AVARRAY[$IUBOUND + 1]
    $AVARRAY[$IUBOUND] = $VVALUE
    Return $IUBOUND
EndFunc
Func _ArrayBinarySearch(Const ByRef $AVARRAY, $VVALUE, $ISTART = 0, $IEND = 0)
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, -1)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(5, 0, -1)
    Local $IUBOUND = UBound($AVARRAY) - 1
    If $IEND < 1 Or $IEND > $IUBOUND Then $IEND = $IUBOUND
    If $ISTART < 0 Then $ISTART = 0
    If $ISTART > $IEND Then Return SetError(4, 0, -1)
    Local $IMID = Int(($IEND + $ISTART) / 2)
    If $AVARRAY[$ISTART] > $VVALUE Or $AVARRAY[$IEND] < $VVALUE Then Return SetError(2, 0, -1)
    While $ISTART <= $IMID And $VVALUE <> $AVARRAY[$IMID]
        If $VVALUE < $AVARRAY[$IMID] Then
            $IEND = $IMID - 1
        Else
            $ISTART = $IMID + 1
        EndIf
        $IMID = Int(($IEND + $ISTART) / 2)
    WEnd
    If $ISTART > $IEND Then Return SetError(3, 0, -1)
    Return $IMID
EndFunc
Func _ArrayCombinations(ByRef $AVARRAY, $ISET, $SDELIM = "")
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, 0)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(2, 0, 0)
    Local $IN = UBound($AVARRAY)
    Local $IR = $ISET
    Local $AIDX[$IR]
    For $I = 0 To $IR - 1
        $AIDX[$I] = $I
    Next
    Local $ITOTAL = __ARRAY_COMBINATIONS($IN, $IR)
    Local $ILEFT = $ITOTAL
    Local $ARESULT[$ITOTAL + 1]
    $ARESULT[0] = $ITOTAL
    Local $ICOUNT = 1
    While $ILEFT > 0
        __ARRAY_GETNEXT($IN, $IR, $ILEFT, $ITOTAL, $AIDX)
        For $I = 0 To $ISET - 1
            $ARESULT[$ICOUNT] &= $AVARRAY[$AIDX[$I]] & $SDELIM
        Next
        If $SDELIM <> "" Then $ARESULT[$ICOUNT] = StringTrimRight($ARESULT[$ICOUNT], 1)
        $ICOUNT += 1
    WEnd
    Return $ARESULT
EndFunc
Func _ArrayConcatenate(ByRef $AVARRAYTARGET, Const ByRef $AVARRAYSOURCE, $ISTART = 0)
    If Not IsArray($AVARRAYTARGET) Then Return SetError(1, 0, 0)
    If Not IsArray($AVARRAYSOURCE) Then Return SetError(2, 0, 0)
    If UBound($AVARRAYTARGET, 0) <> 1 Then
        If UBound($AVARRAYSOURCE, 0) <> 1 Then Return SetError(5, 0, 0)
        Return SetError(3, 0, 0)
    EndIf
    If UBound($AVARRAYSOURCE, 0) <> 1 Then Return SetError(4, 0, 0)
    Local $IUBOUNDTARGET = UBound($AVARRAYTARGET) - $ISTART, $IUBOUNDSOURCE = UBound($AVARRAYSOURCE)
    ReDim $AVARRAYTARGET[$IUBOUNDTARGET + $IUBOUNDSOURCE]
    For $I = $ISTART To $IUBOUNDSOURCE - 1
        $AVARRAYTARGET[$IUBOUNDTARGET + $I] = $AVARRAYSOURCE[$I]
    Next
    Return $IUBOUNDTARGET + $IUBOUNDSOURCE
EndFunc
Func _ARRAYCREATE($V_0, $V_1 = 0, $V_2 = 0, $V_3 = 0, $V_4 = 0, $V_5 = 0, $V_6 = 0, $V_7 = 0, $V_8 = 0, $V_9 = 0, $V_10 = 0, $V_11 = 0, $V_12 = 0, $V_13 = 0, $V_14 = 0, $V_15 = 0, $V_16 = 0, $V_17 = 0, $V_18 = 0, $V_19 = 0, $V_20 = 0)
    Local $AV_ARRAY[21] = [$V_0, $V_1, $V_2, $V_3, $V_4, $V_5, $V_6, $V_7, $V_8, $V_9, $V_10, $V_11, $V_12, $V_13, $V_14, $V_15, $V_16, $V_17, $V_18, $V_19, $V_20]
    ReDim $AV_ARRAY[@NumParams]
    Return $AV_ARRAY
EndFunc
Func _ArrayDelete(ByRef $AVARRAY, $IELEMENT)
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, 0)
    Local $IUBOUND = UBound($AVARRAY, 1) - 1
    If Not $IUBOUND Then
        $AVARRAY = ""
        Return 0
    EndIf
    If $IELEMENT < 0 Then $IELEMENT = 0
    If $IELEMENT > $IUBOUND Then $IELEMENT = $IUBOUND
    Switch UBound($AVARRAY, 0)
        Case 1
            For $I = $IELEMENT To $IUBOUND - 1
                $AVARRAY[$I] = $AVARRAY[$I + 1]
            Next
            ReDim $AVARRAY[$IUBOUND]
        Case 2
            Local $ISUBMAX = UBound($AVARRAY, 2) - 1
            For $I = $IELEMENT To $IUBOUND - 1
                For $J = 0 To $ISUBMAX
                    $AVARRAY[$I][$J] = $AVARRAY[$I + 1][$J]
                Next
            Next
            ReDim $AVARRAY[$IUBOUND][$ISUBMAX + 1]
        Case Else
            Return SetError(3, 0, 0)
    EndSwitch
    Return $IUBOUND
EndFunc
Func _ArrayDisplay(Const ByRef $AVARRAY, $STITLE = "Array: ListView Display", $IITEMLIMIT = -1, $ITRANSPOSE = 0, $SSEPARATOR = "", $SREPLACE = "|", $SHEADER = "")
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, 0)
    Local $IDIMENSION = UBound($AVARRAY, 0), $IUBOUND = UBound($AVARRAY, 1) - 1, $ISUBMAX = UBound($AVARRAY, 2) - 1
    If $IDIMENSION > 2 Then Return SetError(2, 0, 0)
    If $SSEPARATOR = "" Then $SSEPARATOR = Chr(124)
    If _ArraySearch($AVARRAY, $SSEPARATOR, 0, 0, 0, 1) <> -1 Then
        For $X = 1 To 255
            If $X >= 32 And $X <= 127 Then ContinueLoop
            Local $SFIND = _ArraySearch($AVARRAY, Chr($X), 0, 0, 0, 1)
            If $SFIND = -1 Then
                $SSEPARATOR = Chr($X)
                ExitLoop
            EndIf
        Next
    EndIf
    Local $VTMP, $IBUFFER = 64
    Local $ICOLLIMIT = 250
    Local $IONEVENTMODE = Opt("GUIOnEventMode", 0), $SDATASEPARATORCHAR = Opt("GUIDataSeparatorChar", $SSEPARATOR)
    If $ISUBMAX < 0 Then $ISUBMAX = 0
    If $ITRANSPOSE Then
        $VTMP = $IUBOUND
        $IUBOUND = $ISUBMAX
        $ISUBMAX = $VTMP
    EndIf
    If $ISUBMAX > $ICOLLIMIT Then $ISUBMAX = $ICOLLIMIT
    If $IITEMLIMIT < 1 Then $IITEMLIMIT = $IUBOUND
    If $IUBOUND > $IITEMLIMIT Then $IUBOUND = $IITEMLIMIT
    If $SHEADER = "" Then
        $SHEADER = "Row  "
        For $I = 0 To $ISUBMAX
            $SHEADER &= $SSEPARATOR & "Col " & $I
        Next
    EndIf
    Local $AVARRAYTEXT[$IUBOUND + 1]
    For $I = 0 To $IUBOUND
        $AVARRAYTEXT[$I] = "[" & $I & "]"
        For $J = 0 To $ISUBMAX
            If $IDIMENSION = 1 Then
                If $ITRANSPOSE Then
                    $VTMP = $AVARRAY[$J]
                Else
                    $VTMP = $AVARRAY[$I]
                EndIf
            Else
                If $ITRANSPOSE Then
                    $VTMP = $AVARRAY[$J][$I]
                Else
                    $VTMP = $AVARRAY[$I][$J]
                EndIf
            EndIf
            $VTMP = StringReplace($VTMP, $SSEPARATOR, $SREPLACE, 0, 1)
            $AVARRAYTEXT[$I] &= $SSEPARATOR & $VTMP
            $VTMP = StringLen($VTMP)
            If $VTMP > $IBUFFER Then $IBUFFER = $VTMP
        Next
    Next
    $IBUFFER += 1
    Local Const $_ARRAYCONSTANT_GUI_DOCKBORDERS = 102
    Local Const $_ARRAYCONSTANT_GUI_DOCKBOTTOM = 64
    Local Const $_ARRAYCONSTANT_GUI_DOCKHEIGHT = 512
    Local Const $_ARRAYCONSTANT_GUI_DOCKLEFT = 2
    Local Const $_ARRAYCONSTANT_GUI_DOCKRIGHT = 4
    Local Const $_ARRAYCONSTANT_GUI_EVENT_CLOSE = -3
    Local Const $_ARRAYCONSTANT_LVIF_PARAM = 4
    Local Const $_ARRAYCONSTANT_LVIF_TEXT = 1
    Local Const $_ARRAYCONSTANT_LVM_GETCOLUMNWIDTH = (4096 + 29)
    Local Const $_ARRAYCONSTANT_LVM_GETITEMCOUNT = (4096 + 4)
    Local Const $_ARRAYCONSTANT_LVM_GETITEMSTATE = (4096 + 44)
    Local Const $_ARRAYCONSTANT_LVM_INSERTITEMW = (4096 + 77)
    Local Const $_ARRAYCONSTANT_LVM_SETEXTENDEDLISTVIEWSTYLE = (4096 + 54)
    Local Const $_ARRAYCONSTANT_LVM_SETITEMW = (4096 + 76)
    Local Const $_ARRAYCONSTANT_LVS_EX_FULLROWSELECT = 32
    Local Const $_ARRAYCONSTANT_LVS_EX_GRIDLINES = 1
    Local Const $_ARRAYCONSTANT_LVS_SHOWSELALWAYS = 8
    Local Const $_ARRAYCONSTANT_WS_EX_CLIENTEDGE = 512
    Local Const $_ARRAYCONSTANT_WS_MAXIMIZEBOX = 65536
    Local Const $_ARRAYCONSTANT_WS_MINIMIZEBOX = 131072
    Local Const $_ARRAYCONSTANT_WS_SIZEBOX = 262144
    Local Const $_ARRAYCONSTANT_TAGLVITEM = "int Mask;int Item;int SubItem;int State;int StateMask;ptr Text;int TextMax;int Image;int Param;int Indent;int GroupID;int Columns;ptr pColumns"
    Local $IADDMASK = BitOR($_ARRAYCONSTANT_LVIF_TEXT, $_ARRAYCONSTANT_LVIF_PARAM)
    Local $TBUFFER = DllStructCreate("wchar Text[" & $IBUFFER & "]"), $PBUFFER = DllStructGetPtr($TBUFFER)
    Local $TITEM = DllStructCreate($_ARRAYCONSTANT_TAGLVITEM), $PITEM = DllStructGetPtr($TITEM)
    DllStructSetData($TITEM, "Param", 0)
    DllStructSetData($TITEM, "Text", $PBUFFER)
    DllStructSetData($TITEM, "TextMax", $IBUFFER)
    Local $IWIDTH = 640, $IHEIGHT = 480
    Local $HGUI = GUICreate($STITLE, $IWIDTH, $IHEIGHT, Default, Default, BitOR($_ARRAYCONSTANT_WS_SIZEBOX, $_ARRAYCONSTANT_WS_MINIMIZEBOX, $_ARRAYCONSTANT_WS_MAXIMIZEBOX))
    Local $AIGUISIZE = WinGetClientSize($HGUI)
    Local $HLISTVIEW = GUICtrlCreateListView($SHEADER, 0, 0, $AIGUISIZE[0], $AIGUISIZE[1] - 26, $_ARRAYCONSTANT_LVS_SHOWSELALWAYS)
    Local $HCOPY = GUICtrlCreateButton("Copy Selected", 3, $AIGUISIZE[1] - 23, $AIGUISIZE[0] - 6, 20)
    GUICtrlSetResizing($HLISTVIEW, $_ARRAYCONSTANT_GUI_DOCKBORDERS)
    GUICtrlSetResizing($HCOPY, $_ARRAYCONSTANT_GUI_DOCKLEFT + $_ARRAYCONSTANT_GUI_DOCKRIGHT + $_ARRAYCONSTANT_GUI_DOCKBOTTOM + $_ARRAYCONSTANT_GUI_DOCKHEIGHT)
    GUICtrlSendMsg($HLISTVIEW, $_ARRAYCONSTANT_LVM_SETEXTENDEDLISTVIEWSTYLE, $_ARRAYCONSTANT_LVS_EX_GRIDLINES, $_ARRAYCONSTANT_LVS_EX_GRIDLINES)
    GUICtrlSendMsg($HLISTVIEW, $_ARRAYCONSTANT_LVM_SETEXTENDEDLISTVIEWSTYLE, $_ARRAYCONSTANT_LVS_EX_FULLROWSELECT, $_ARRAYCONSTANT_LVS_EX_FULLROWSELECT)
    GUICtrlSendMsg($HLISTVIEW, $_ARRAYCONSTANT_LVM_SETEXTENDEDLISTVIEWSTYLE, $_ARRAYCONSTANT_WS_EX_CLIENTEDGE, $_ARRAYCONSTANT_WS_EX_CLIENTEDGE)
    Local $AITEM
    For $I = 0 To $IUBOUND
        If GUICtrlCreateListViewItem($AVARRAYTEXT[$I], $HLISTVIEW) = 0 Then
            $AITEM = StringSplit($AVARRAYTEXT[$I], $SSEPARATOR)
            DllStructSetData($TBUFFER, "Text", $AITEM[1])
            DllStructSetData($TITEM, "Item", $I)
            DllStructSetData($TITEM, "SubItem", 0)
            DllStructSetData($TITEM, "Mask", $IADDMASK)
            GUICtrlSendMsg($HLISTVIEW, $_ARRAYCONSTANT_LVM_INSERTITEMW, 0, $PITEM)
            DllStructSetData($TITEM, "Mask", $_ARRAYCONSTANT_LVIF_TEXT)
            For $J = 2 To $AITEM[0]
                DllStructSetData($TBUFFER, "Text", $AITEM[$J])
                DllStructSetData($TITEM, "SubItem", $J - 1)
                GUICtrlSendMsg($HLISTVIEW, $_ARRAYCONSTANT_LVM_SETITEMW, 0, $PITEM)
            Next
        EndIf
    Next
    $IWIDTH = 0
    For $I = 0 To $ISUBMAX + 1
        $IWIDTH += GUICtrlSendMsg($HLISTVIEW, $_ARRAYCONSTANT_LVM_GETCOLUMNWIDTH, $I, 0)
    Next
    If $IWIDTH < 250 Then $IWIDTH = 230
    $IWIDTH += 20
    If $IWIDTH > @DesktopWidth Then $IWIDTH = @DesktopWidth - 100
    WinMove($HGUI, "", (@DesktopWidth - $IWIDTH) / 2, Default, $IWIDTH)
    GUISetState(@SW_SHOW, $HGUI)
    While 1
        Switch GUIGetMsg()
            Case $_ARRAYCONSTANT_GUI_EVENT_CLOSE
                ExitLoop
            Case $HCOPY
                Local $SCLIP = ""
                Local $AICURITEMS[1] = [0]
                For $I = 0 To GUICtrlSendMsg($HLISTVIEW, $_ARRAYCONSTANT_LVM_GETITEMCOUNT, 0, 0)
                    If GUICtrlSendMsg($HLISTVIEW, $_ARRAYCONSTANT_LVM_GETITEMSTATE, $I, 2) Then
                        $AICURITEMS[0] += 1
                        ReDim $AICURITEMS[$AICURITEMS[0] + 1]
                        $AICURITEMS[$AICURITEMS[0]] = $I
                    EndIf
                Next
                If Not $AICURITEMS[0] Then
                    For $SITEM In $AVARRAYTEXT
                        $SCLIP &= $SITEM & @CRLF
                    Next
                Else
                    For $I = 1 To UBound($AICURITEMS) - 1
                        $SCLIP &= $AVARRAYTEXT[$AICURITEMS[$I]] & @CRLF
                    Next
                EndIf
                ClipPut($SCLIP)
        EndSwitch
    WEnd
    GUIDelete($HGUI)
    Opt("GUIOnEventMode", $IONEVENTMODE)
    Opt("GUIDataSeparatorChar", $SDATASEPARATORCHAR)
    Return 1
EndFunc
Func _ArrayFindAll(Const ByRef $AVARRAY, $VVALUE, $ISTART = 0, $IEND = 0, $ICASE = 0, $IPARTIAL = 0, $ISUBITEM = 0)
    $ISTART = _ArraySearch($AVARRAY, $VVALUE, $ISTART, $IEND, $ICASE, $IPARTIAL, 1, $ISUBITEM)
    If @error Then Return SetError(@error, 0, -1)
    Local $IINDEX = 0, $AVRESULT[UBound($AVARRAY)]
    Do
        $AVRESULT[$IINDEX] = $ISTART
        $IINDEX += 1
        $ISTART = _ArraySearch($AVARRAY, $VVALUE, $ISTART + 1, $IEND, $ICASE, $IPARTIAL, 1, $ISUBITEM)
    Until @error
    ReDim $AVRESULT[$IINDEX]
    Return $AVRESULT
EndFunc
Func _ArrayInsert(ByRef $AVARRAY, $IELEMENT, $VVALUE = "")
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, 0)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(2, 0, 0)
    Local $IUBOUND = UBound($AVARRAY) + 1
    ReDim $AVARRAY[$IUBOUND]
    For $I = $IUBOUND - 1 To $IELEMENT + 1 Step -1
        $AVARRAY[$I] = $AVARRAY[$I - 1]
    Next
    $AVARRAY[$IELEMENT] = $VVALUE
    Return $IUBOUND
EndFunc
Func _ArrayMax(Const ByRef $AVARRAY, $ICOMPNUMERIC = 0, $ISTART = 0, $IEND = 0)
    Local $IRESULT = _ArrayMaxIndex($AVARRAY, $ICOMPNUMERIC, $ISTART, $IEND)
    If @error Then Return SetError(@error, 0, "")
    Return $AVARRAY[$IRESULT]
EndFunc
Func _ArrayMaxIndex(Const ByRef $AVARRAY, $ICOMPNUMERIC = 0, $ISTART = 0, $IEND = 0)
    If Not IsArray($AVARRAY) Or UBound($AVARRAY, 0) <> 1 Then Return SetError(1, 0, -1)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(3, 0, -1)
    Local $IUBOUND = UBound($AVARRAY) - 1
    If $IEND < 1 Or $IEND > $IUBOUND Then $IEND = $IUBOUND
    If $ISTART < 0 Then $ISTART = 0
    If $ISTART > $IEND Then Return SetError(2, 0, -1)
    Local $IMAXINDEX = $ISTART
    If $ICOMPNUMERIC Then
        For $I = $ISTART To $IEND
            If Number($AVARRAY[$IMAXINDEX]) < Number($AVARRAY[$I]) Then $IMAXINDEX = $I
        Next
    Else
        For $I = $ISTART To $IEND
            If $AVARRAY[$IMAXINDEX] < $AVARRAY[$I] Then $IMAXINDEX = $I
        Next
    EndIf
    Return $IMAXINDEX
EndFunc
Func _ArrayMin(Const ByRef $AVARRAY, $ICOMPNUMERIC = 0, $ISTART = 0, $IEND = 0)
    Local $IRESULT = _ArrayMinIndex($AVARRAY, $ICOMPNUMERIC, $ISTART, $IEND)
    If @error Then Return SetError(@error, 0, "")
    Return $AVARRAY[$IRESULT]
EndFunc
Func _ArrayMinIndex(Const ByRef $AVARRAY, $ICOMPNUMERIC = 0, $ISTART = 0, $IEND = 0)
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, -1)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(3, 0, -1)
    Local $IUBOUND = UBound($AVARRAY) - 1
    If $IEND < 1 Or $IEND > $IUBOUND Then $IEND = $IUBOUND
    If $ISTART < 0 Then $ISTART = 0
    If $ISTART > $IEND Then Return SetError(2, 0, -1)
    Local $IMININDEX = $ISTART
    If $ICOMPNUMERIC Then
        For $I = $ISTART To $IEND
            If Number($AVARRAY[$IMININDEX]) > Number($AVARRAY[$I]) Then $IMININDEX = $I
        Next
    Else
        For $I = $ISTART To $IEND
            If $AVARRAY[$IMININDEX] > $AVARRAY[$I] Then $IMININDEX = $I
        Next
    EndIf
    Return $IMININDEX
EndFunc
Func _ArrayPermute(ByRef $AVARRAY, $SDELIM = "")
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, 0)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(2, 0, 0)
    Local $ISIZE = UBound($AVARRAY), $IFACTORIAL = 1, $AIDX[$ISIZE], $ARESULT[1], $ICOUNT = 1
    For $I = 0 To $ISIZE - 1
        $AIDX[$I] = $I
    Next
    For $I = $ISIZE To 1 Step -1
        $IFACTORIAL *= $I
    Next
    ReDim $ARESULT[$IFACTORIAL + 1]
    $ARESULT[0] = $IFACTORIAL
    __ARRAY_EXETERINTERNAL($AVARRAY, 0, $ISIZE, $SDELIM, $AIDX, $ARESULT, $ICOUNT)
    Return $ARESULT
EndFunc
Func _ArrayPop(ByRef $AVARRAY)
    If (Not IsArray($AVARRAY)) Then Return SetError(1, 0, "")
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(2, 0, "")
    Local $IUBOUND = UBound($AVARRAY) - 1, $SLASTVAL = $AVARRAY[$IUBOUND]
    If Not $IUBOUND Then
        $AVARRAY = ""
    Else
        ReDim $AVARRAY[$IUBOUND]
    EndIf
    Return $SLASTVAL
EndFunc
Func _ArrayPush(ByRef $AVARRAY, $VVALUE, $IDIRECTION = 0)
    If (Not IsArray($AVARRAY)) Then Return SetError(1, 0, 0)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(3, 0, 0)
    Local $IUBOUND = UBound($AVARRAY) - 1
    If IsArray($VVALUE) Then
        Local $IUBOUNDS = UBound($VVALUE)
        If ($IUBOUNDS - 1) > $IUBOUND Then Return SetError(2, 0, 0)
        If $IDIRECTION Then
            For $I = $IUBOUND To $IUBOUNDS Step -1
                $AVARRAY[$I] = $AVARRAY[$I - $IUBOUNDS]
            Next
            For $I = 0 To $IUBOUNDS - 1
                $AVARRAY[$I] = $VVALUE[$I]
            Next
        Else
            For $I = 0 To $IUBOUND - $IUBOUNDS
                $AVARRAY[$I] = $AVARRAY[$I + $IUBOUNDS]
            Next
            For $I = 0 To $IUBOUNDS - 1
                $AVARRAY[$I + $IUBOUND - $IUBOUNDS + 1] = $VVALUE[$I]
            Next
        EndIf
    Else
        If $IDIRECTION Then
            For $I = $IUBOUND To 1 Step -1
                $AVARRAY[$I] = $AVARRAY[$I - 1]
            Next
            $AVARRAY[0] = $VVALUE
        Else
            For $I = 0 To $IUBOUND - 1
                $AVARRAY[$I] = $AVARRAY[$I + 1]
            Next
            $AVARRAY[$IUBOUND] = $VVALUE
        EndIf
    EndIf
    Return 1
EndFunc
Func _ArrayReverse(ByRef $AVARRAY, $ISTART = 0, $IEND = 0)
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, 0)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(3, 0, 0)
    Local $VTMP, $IUBOUND = UBound($AVARRAY) - 1
    If $IEND < 1 Or $IEND > $IUBOUND Then $IEND = $IUBOUND
    If $ISTART < 0 Then $ISTART = 0
    If $ISTART > $IEND Then Return SetError(2, 0, 0)
    For $I = $ISTART To Int(($ISTART + $IEND - 1) / 2)
        $VTMP = $AVARRAY[$I]
        $AVARRAY[$I] = $AVARRAY[$IEND]
        $AVARRAY[$IEND] = $VTMP
        $IEND -= 1
    Next
    Return 1
EndFunc
Func _ArraySearch(Const ByRef $AVARRAY, $VVALUE, $ISTART = 0, $IEND = 0, $ICASE = 0, $IPARTIAL = 0, $IFORWARD = 1, $ISUBITEM = -1)
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, -1)
    If UBound($AVARRAY, 0) > 2 Or UBound($AVARRAY, 0) < 1 Then Return SetError(2, 0, -1)
    Local $IUBOUND = UBound($AVARRAY) - 1
    If $IEND < 1 Or $IEND > $IUBOUND Then $IEND = $IUBOUND
    If $ISTART < 0 Then $ISTART = 0
    If $ISTART > $IEND Then Return SetError(4, 0, -1)
    Local $ISTEP = 1
    If Not $IFORWARD Then
        Local $ITMP = $ISTART
        $ISTART = $IEND
        $IEND = $ITMP
        $ISTEP = -1
    EndIf
    Switch UBound($AVARRAY, 0)
        Case 1
            If Not $IPARTIAL Then
                If Not $ICASE Then
                    For $I = $ISTART To $IEND Step $ISTEP
                        If $AVARRAY[$I] = $VVALUE Then Return $I
                    Next
                Else
                    For $I = $ISTART To $IEND Step $ISTEP
                        If $AVARRAY[$I] == $VVALUE Then Return $I
                    Next
                EndIf
            Else
                For $I = $ISTART To $IEND Step $ISTEP
                    If StringInStr($AVARRAY[$I], $VVALUE, $ICASE) > 0 Then Return $I
                Next
            EndIf
        Case 2
            Local $IUBOUNDSUB = UBound($AVARRAY, 2) - 1
            If $ISUBITEM > $IUBOUNDSUB Then $ISUBITEM = $IUBOUNDSUB
            If $ISUBITEM < 0 Then
                $ISUBITEM = 0
            Else
                $IUBOUNDSUB = $ISUBITEM
            EndIf
            For $J = $ISUBITEM To $IUBOUNDSUB
                If Not $IPARTIAL Then
                    If Not $ICASE Then
                        For $I = $ISTART To $IEND Step $ISTEP
                            If $AVARRAY[$I][$J] = $VVALUE Then Return $I
                        Next
                    Else
                        For $I = $ISTART To $IEND Step $ISTEP
                            If $AVARRAY[$I][$J] == $VVALUE Then Return $I
                        Next
                    EndIf
                Else
                    For $I = $ISTART To $IEND Step $ISTEP
                        If StringInStr($AVARRAY[$I][$J], $VVALUE, $ICASE) > 0 Then Return $I
                    Next
                EndIf
            Next
        Case Else
            Return SetError(7, 0, -1)
    EndSwitch
    Return SetError(6, 0, -1)
EndFunc
Func _ArraySort(ByRef $AVARRAY, $IDESCENDING = 0, $ISTART = 0, $IEND = 0, $ISUBITEM = 0)
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, 0)
    Local $IUBOUND = UBound($AVARRAY) - 1
    If $IEND < 1 Or $IEND > $IUBOUND Then $IEND = $IUBOUND
    If $ISTART < 0 Then $ISTART = 0
    If $ISTART > $IEND Then Return SetError(2, 0, 0)
    Switch UBound($AVARRAY, 0)
        Case 1
            __ARRAYQUICKSORT1D($AVARRAY, $ISTART, $IEND)
            If $IDESCENDING Then _ArrayReverse($AVARRAY, $ISTART, $IEND)
        Case 2
            Local $ISUBMAX = UBound($AVARRAY, 2) - 1
            If $ISUBITEM > $ISUBMAX Then Return SetError(3, 0, 0)
            If $IDESCENDING Then
                $IDESCENDING = -1
            Else
                $IDESCENDING = 1
            EndIf
            __ARRAYQUICKSORT2D($AVARRAY, $IDESCENDING, $ISTART, $IEND, $ISUBITEM, $ISUBMAX)
        Case Else
            Return SetError(4, 0, 0)
    EndSwitch
    Return 1
EndFunc
Func __ARRAYQUICKSORT1D(ByRef $AVARRAY, ByRef $ISTART, ByRef $IEND)
    If $IEND <= $ISTART Then Return
    Local $VTMP
    If ($IEND - $ISTART) < 15 Then
        Local $VCUR
        For $I = $ISTART + 1 To $IEND
            $VTMP = $AVARRAY[$I]
            If IsNumber($VTMP) Then
                For $J = $I - 1 To $ISTART Step -1
                    $VCUR = $AVARRAY[$J]
                    If ($VTMP >= $VCUR And IsNumber($VCUR)) Or (Not IsNumber($VCUR) And StringCompare($VTMP, $VCUR) >= 0) Then ExitLoop
                    $AVARRAY[$J + 1] = $VCUR
                Next
            Else
                For $J = $I - 1 To $ISTART Step -1
                    If (StringCompare($VTMP, $AVARRAY[$J]) >= 0) Then ExitLoop
                    $AVARRAY[$J + 1] = $AVARRAY[$J]
                Next
            EndIf
            $AVARRAY[$J + 1] = $VTMP
        Next
        Return
    EndIf
    Local $L = $ISTART, $R = $IEND, $VPIVOT = $AVARRAY[Int(($ISTART + $IEND) / 2)], $FNUM = IsNumber($VPIVOT)
    Do
        If $FNUM Then
            While ($AVARRAY[$L] < $VPIVOT And IsNumber($AVARRAY[$L])) Or (Not IsNumber($AVARRAY[$L]) And StringCompare($AVARRAY[$L], $VPIVOT) < 0)
                $L += 1
            WEnd
            While ($AVARRAY[$R] > $VPIVOT And IsNumber($AVARRAY[$R])) Or (Not IsNumber($AVARRAY[$R]) And StringCompare($AVARRAY[$R], $VPIVOT) > 0)
                $R -= 1
            WEnd
        Else
            While (StringCompare($AVARRAY[$L], $VPIVOT) < 0)
                $L += 1
            WEnd
            While (StringCompare($AVARRAY[$R], $VPIVOT) > 0)
                $R -= 1
            WEnd
        EndIf
        If $L <= $R Then
            $VTMP = $AVARRAY[$L]
            $AVARRAY[$L] = $AVARRAY[$R]
            $AVARRAY[$R] = $VTMP
            $L += 1
            $R -= 1
        EndIf
    Until $L > $R
    __ARRAYQUICKSORT1D($AVARRAY, $ISTART, $R)
    __ARRAYQUICKSORT1D($AVARRAY, $L, $IEND)
EndFunc
Func __ARRAYQUICKSORT2D(ByRef $AVARRAY, ByRef $ISTEP, ByRef $ISTART, ByRef $IEND, ByRef $ISUBITEM, ByRef $ISUBMAX)
    If $IEND <= $ISTART Then Return
    Local $VTMP, $L = $ISTART, $R = $IEND, $VPIVOT = $AVARRAY[Int(($ISTART + $IEND) / 2)][$ISUBITEM], $FNUM = IsNumber($VPIVOT)
    Do
        If $FNUM Then
            While ($ISTEP * ($AVARRAY[$L][$ISUBITEM] - $VPIVOT) < 0 And IsNumber($AVARRAY[$L][$ISUBITEM])) Or (Not IsNumber($AVARRAY[$L][$ISUBITEM]) And $ISTEP * StringCompare($AVARRAY[$L][$ISUBITEM], $VPIVOT) < 0)
                $L += 1
            WEnd
            While ($ISTEP * ($AVARRAY[$R][$ISUBITEM] - $VPIVOT) > 0 And IsNumber($AVARRAY[$R][$ISUBITEM])) Or (Not IsNumber($AVARRAY[$R][$ISUBITEM]) And $ISTEP * StringCompare($AVARRAY[$R][$ISUBITEM], $VPIVOT) > 0)
                $R -= 1
            WEnd
        Else
            While ($ISTEP * StringCompare($AVARRAY[$L][$ISUBITEM], $VPIVOT) < 0)
                $L += 1
            WEnd
            While ($ISTEP * StringCompare($AVARRAY[$R][$ISUBITEM], $VPIVOT) > 0)
                $R -= 1
            WEnd
        EndIf
        If $L <= $R Then
            For $I = 0 To $ISUBMAX
                $VTMP = $AVARRAY[$L][$I]
                $AVARRAY[$L][$I] = $AVARRAY[$R][$I]
                $AVARRAY[$R][$I] = $VTMP
            Next
            $L += 1
            $R -= 1
        EndIf
    Until $L > $R
    __ARRAYQUICKSORT2D($AVARRAY, $ISTEP, $ISTART, $R, $ISUBITEM, $ISUBMAX)
    __ARRAYQUICKSORT2D($AVARRAY, $ISTEP, $L, $IEND, $ISUBITEM, $ISUBMAX)
EndFunc
Func _ArraySwap(ByRef $VITEM1, ByRef $VITEM2)
    Local $VTMP = $VITEM1
    $VITEM1 = $VITEM2
    $VITEM2 = $VTMP
EndFunc
Func _ArrayToClip(Const ByRef $AVARRAY, $ISTART = 0, $IEND = 0)
    Local $SRESULT = _ArrayToString($AVARRAY, @CR, $ISTART, $IEND)
    If @error Then Return SetError(@error, 0, 0)
    Return ClipPut($SRESULT)
EndFunc
Func _ArrayToString(Const ByRef $AVARRAY, $SDELIM = "|", $ISTART = 0, $IEND = 0)
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, "")
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(3, 0, "")
    Local $SRESULT, $IUBOUND = UBound($AVARRAY) - 1
    If $IEND < 1 Or $IEND > $IUBOUND Then $IEND = $IUBOUND
    If $ISTART < 0 Then $ISTART = 0
    If $ISTART > $IEND Then Return SetError(2, 0, "")
    For $I = $ISTART To $IEND
        $SRESULT &= $AVARRAY[$I] & $SDELIM
    Next
    Return StringTrimRight($SRESULT, StringLen($SDELIM))
EndFunc
Func _ArrayTrim(ByRef $AVARRAY, $ITRIMNUM, $IDIRECTION = 0, $ISTART = 0, $IEND = 0)
    If Not IsArray($AVARRAY) Then Return SetError(1, 0, 0)
    If UBound($AVARRAY, 0) <> 1 Then Return SetError(2, 0, 0)
    Local $IUBOUND = UBound($AVARRAY) - 1
    If $IEND < 1 Or $IEND > $IUBOUND Then $IEND = $IUBOUND
    If $ISTART < 0 Then $ISTART = 0
    If $ISTART > $IEND Then Return SetError(5, 0, 0)
    If $IDIRECTION Then
        For $I = $ISTART To $IEND
            $AVARRAY[$I] = StringTrimRight($AVARRAY[$I], $ITRIMNUM)
        Next
    Else
        For $I = $ISTART To $IEND
            $AVARRAY[$I] = StringTrimLeft($AVARRAY[$I], $ITRIMNUM)
        Next
    EndIf
    Return 1
EndFunc
Func _ArrayUnique($AARRAY, $IDIMENSION = 1, $IBASE = 0, $ICASE = 0, $VDELIM = "|")
    Local $IUBOUNDDIM
    If $VDELIM = "|" Then $VDELIM = Chr(1)
    If Not IsArray($AARRAY) Then Return SetError(1, 0, 0)
    If Not $IDIMENSION > 0 Then
        Return SetError(3, 0, 0)
    Else
        $IUBOUNDDIM = UBound($AARRAY, 1)
        If @error Then Return SetError(3, 0, 0)
        If $IDIMENSION > 1 Then
            Local $AARRAYTMP[1]
            For $I = 0 To $IUBOUNDDIM - 1
                _ArrayAdd($AARRAYTMP, $AARRAY[$I][$IDIMENSION - 1])
            Next
            _ArrayDelete($AARRAYTMP, 0)
        Else
            If UBound($AARRAY, 0) = 1 Then
                Dim $AARRAYTMP[1]
                For $I = 0 To $IUBOUNDDIM - 1
                    _ArrayAdd($AARRAYTMP, $AARRAY[$I])
                Next
                _ArrayDelete($AARRAYTMP, 0)
            Else
                Dim $AARRAYTMP[1]
                For $I = 0 To $IUBOUNDDIM - 1
                    _ArrayAdd($AARRAYTMP, $AARRAY[$I][$IDIMENSION - 1])
                Next
                _ArrayDelete($AARRAYTMP, 0)
            EndIf
        EndIf
    EndIf
    Local $SHOLD
    For $ICC = $IBASE To UBound($AARRAYTMP) - 1
        If Not StringInStr($VDELIM & $SHOLD, $VDELIM & $AARRAYTMP[$ICC] & $VDELIM, $ICASE) Then $SHOLD &= $AARRAYTMP[$ICC] & $VDELIM
    Next
    If $SHOLD Then
        $AARRAYTMP = StringSplit(StringTrimRight($SHOLD, StringLen($VDELIM)), $VDELIM, 1)
        Return $AARRAYTMP
    EndIf
    Return SetError(2, 0, 0)
EndFunc
Func __ARRAY_EXETERINTERNAL(ByRef $AVARRAY, $ISTART, $ISIZE, $SDELIM, ByRef $AIDX, ByRef $ARESULT, ByRef $ICOUNT)
    If $ISTART == $ISIZE - 1 Then
        For $I = 0 To $ISIZE - 1
            $ARESULT[$ICOUNT] &= $AVARRAY[$AIDX[$I]] & $SDELIM
        Next
        If $SDELIM <> "" Then $ARESULT[$ICOUNT] = StringTrimRight($ARESULT[$ICOUNT], 1)
        $ICOUNT += 1
    Else
        Local $ITEMP
        For $I = $ISTART To $ISIZE - 1
            $ITEMP = $AIDX[$I]
            $AIDX[$I] = $AIDX[$ISTART]
            $AIDX[$ISTART] = $ITEMP
            __ARRAY_EXETERINTERNAL($AVARRAY, $ISTART + 1, $ISIZE, $SDELIM, $AIDX, $ARESULT, $ICOUNT)
            $AIDX[$ISTART] = $AIDX[$I]
            $AIDX[$I] = $ITEMP
        Next
    EndIf
EndFunc
Func __ARRAY_COMBINATIONS($IN, $IR)
    Local $I_TOTAL = 1
    For $I = $IR To 1 Step -1
        $I_TOTAL *= ($IN / $I)
        $IN -= 1
    Next
    Return Round($I_TOTAL)
EndFunc
Func __ARRAY_GETNEXT($IN, $IR, ByRef $ILEFT, $ITOTAL, ByRef $AIDX)
    If $ILEFT == $ITOTAL Then
        $ILEFT -= 1
        Return
    EndIf
    Local $I = $IR - 1
    While $AIDX[$I] == $IN - $IR + $I
        $I -= 1
    WEnd
    $AIDX[$I] += 1
    For $J = $I + 1 To $IR - 1
        $AIDX[$J] = $AIDX[$I] + $J - $I
    Next
    $ILEFT -= 1
EndFunc
Global Const $FC_NOOVERWRITE = 0
Global Const $FC_OVERWRITE = 1
Global Const $FT_MODIFIED = 0
Global Const $FT_CREATED = 1
Global Const $FT_ACCESSED = 2
Global Const $FO_READ = 0
Global Const $FO_APPEND = 1
Global Const $FO_OVERWRITE = 2
Global Const $FO_BINARY = 16
Global Const $FO_UNICODE = 32
Global Const $FO_UTF16_LE = 32
Global Const $FO_UTF16_BE = 64
Global Const $FO_UTF8 = 128
Global Const $FO_UTF8_NOBOM = 256
Global Const $EOF = -1
Global Const $FD_FILEMUSTEXIST = 1
Global Const $FD_PATHMUSTEXIST = 2
Global Const $FD_MULTISELECT = 4
Global Const $FD_PROMPTCREATENEW = 8
Global Const $FD_PROMPTOVERWRITE = 16
Global Const $CREATE_NEW = 1
Global Const $CREATE_ALWAYS = 2
Global Const $OPEN_EXISTING = 3
Global Const $OPEN_ALWAYS = 4
Global Const $TRUNCATE_EXISTING = 5
Global Const $INVALID_SET_FILE_POINTER = -1
Global Const $FILE_BEGIN = 0
Global Const $FILE_CURRENT = 1
Global Const $FILE_END = 2
Global Const $FILE_ATTRIBUTE_READONLY = 1
Global Const $FILE_ATTRIBUTE_HIDDEN = 2
Global Const $FILE_ATTRIBUTE_SYSTEM = 4
Global Const $FILE_ATTRIBUTE_DIRECTORY = 16
Global Const $FILE_ATTRIBUTE_ARCHIVE = 32
Global Const $FILE_ATTRIBUTE_DEVICE = 64
Global Const $FILE_ATTRIBUTE_NORMAL = 128
Global Const $FILE_ATTRIBUTE_TEMPORARY = 256
Global Const $FILE_ATTRIBUTE_SPARSE_FILE = 512
Global Const $FILE_ATTRIBUTE_REPARSE_POINT = 1024
Global Const $FILE_ATTRIBUTE_COMPRESSED = 2048
Global Const $FILE_ATTRIBUTE_OFFLINE = 4096
Global Const $FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192
Global Const $FILE_ATTRIBUTE_ENCRYPTED = 16384
Global Const $FILE_SHARE_READ = 1
Global Const $FILE_SHARE_WRITE = 2
Global Const $FILE_SHARE_DELETE = 4
Global Const $GENERIC_ALL = 268435456
Global Const $GENERIC_EXECUTE = 536870912
Global Const $GENERIC_WRITE = 1073741824
Global Const $GENERIC_READ = -2147483648
Func _FileCountLines($SFILEPATH)
    Local $HFILE = FileOpen($SFILEPATH, $FO_READ)
    If $HFILE = -1 Then Return SetError(1, 0, 0)
    Local $SFILECONTENT = StringStripWS(FileRead($HFILE), 2)
    FileClose($HFILE)
    Local $ATMP
    If StringInStr($SFILECONTENT, @LF) Then
        $ATMP = StringSplit(StringStripCR($SFILECONTENT), @LF)
    ElseIf StringInStr($SFILECONTENT, @CR) Then
        $ATMP = StringSplit($SFILECONTENT, @CR)
    Else
        If StringLen($SFILECONTENT) Then
            Return 1
        Else
            Return SetError(2, 0, 0)
        EndIf
    EndIf
    Return $ATMP[0]
EndFunc
Func _FileCreate($SFILEPATH)
    Local $HOPENFILE = FileOpen($SFILEPATH, $FO_OVERWRITE)
    If $HOPENFILE = -1 Then Return SetError(1, 0, 0)
    Local $HWRITEFILE = FileWrite($HOPENFILE, "")
    FileClose($HOPENFILE)
    If $HWRITEFILE = -1 Then Return SetError(2, 0, 0)
    Return 1
EndFunc
Func _FileListToArray($SPATH, $SFILTER = "*", $IFLAG = 0)
    Local $HSEARCH, $SFILE, $SFILELIST, $SDELIM = "|"
    $SPATH = StringRegExpReplace($SPATH, "[\\/]+\z", "") & "\"
    If Not FileExists($SPATH) Then Return SetError(1, 1, "")
    If StringRegExp($SFILTER, "[\\/:><\|]|(?s)\A\s*\z") Then Return SetError(2, 2, "")
    If Not ($IFLAG = 0 Or $IFLAG = 1 Or $IFLAG = 2) Then Return SetError(3, 3, "")
    $HSEARCH = FileFindFirstFile($SPATH & $SFILTER)
    If @error Then Return SetError(4, 4, "")
    While 1
        $SFILE = FileFindNextFile($HSEARCH)
        If @error Then ExitLoop
        If ($IFLAG + @extended = 2) Then ContinueLoop
        $SFILELIST &= $SDELIM & $SFILE
    WEnd
    FileClose($HSEARCH)
    If Not $SFILELIST Then Return SetError(4, 4, "")
    Return StringSplit(StringTrimLeft($SFILELIST, 1), "|")
EndFunc
Func _FilePrint($S_FILE, $I_SHOW = @SW_HIDE)
    Local $A_RET = DllCall("shell32.dll", "int", "ShellExecuteW", "hwnd", 0, "wstr", "print", "wstr", $S_FILE, "wstr", "", "wstr", "", "int", $I_SHOW)
    If @error Then Return SetError(@error, @extended, 0)
    If $A_RET[0] <= 32 Then Return SetError(10, $A_RET[0], 0)
    Return 1
EndFunc
Func _FileReadToArray($SFILEPATH, ByRef $AARRAY)
    Local $HFILE = FileOpen($SFILEPATH, $FO_READ)
    If $HFILE = -1 Then Return SetError(1, 0, 0)
    Local $AFILE = FileRead($HFILE, FileGetSize($SFILEPATH))
    If StringRight($AFILE, 1) = @LF Then $AFILE = StringTrimRight($AFILE, 1)
    If StringRight($AFILE, 1) = @CR Then $AFILE = StringTrimRight($AFILE, 1)
    FileClose($HFILE)
    If StringInStr($AFILE, @LF) Then
        $AARRAY = StringSplit(StringStripCR($AFILE), @LF)
    ElseIf StringInStr($AFILE, @CR) Then
        $AARRAY = StringSplit($AFILE, @CR)
    Else
        If StringLen($AFILE) Then
            Dim $AARRAY[2] = [1, $AFILE]
        Else
            Return SetError(2, 0, 0)
        EndIf
    EndIf
    Return 1
EndFunc
Func _FileWriteFromArray($FILE, $A_ARRAY, $I_BASE = 0, $I_UBOUND = 0)
    If Not IsArray($A_ARRAY) Then Return SetError(2, 0, 0)
    Local $LAST = UBound($A_ARRAY) - 1
    If $I_UBOUND < 1 Or $I_UBOUND > $LAST Then $I_UBOUND = $LAST
    If $I_BASE < 0 Or $I_BASE > $LAST Then $I_BASE = 0
    Local $HFILE
    If IsString($FILE) Then
        $HFILE = FileOpen($FILE, $FO_OVERWRITE)
    Else
        $HFILE = $FILE
    EndIf
    If $HFILE = -1 Then Return SetError(1, 0, 0)
    Local $ERRORSAV = 0
    For $X = $I_BASE To $I_UBOUND
        If FileWrite($HFILE, $A_ARRAY[$X] & @CRLF) = 0 Then
            $ERRORSAV = 3
            ExitLoop
        EndIf
    Next
    If IsString($FILE) Then FileClose($HFILE)
    If $ERRORSAV Then Return SetError($ERRORSAV, 0, 0)
    Return 1
EndFunc
Func _FileWriteLog($SLOGPATH, $SLOGMSG, $IFLAG = -1)
    Local $IOPENMODE = $FO_APPEND
    Local $SDATENOW = @YEAR & "-" & @MON & "-" & @MDAY
    Local $STIMENOW = @HOUR & ":" & @MIN & ":" & @SEC
    Local $SMSG = $SDATENOW & " " & $STIMENOW & " : " & $SLOGMSG
    If $IFLAG <> -1 Then
        $SMSG &= @CRLF & FileRead($SLOGPATH)
        $IOPENMODE = $FO_OVERWRITE
    EndIf
    Local $HOPENFILE = FileOpen($SLOGPATH, $IOPENMODE)
    If $HOPENFILE = -1 Then Return SetError(1, 0, 0)
    Local $IWRITEFILE = FileWriteLine($HOPENFILE, $SMSG)
    Local $IRET = FileClose($HOPENFILE)
    If $IWRITEFILE = -1 Then Return SetError(2, $IRET, 0)
    Return $IRET
EndFunc
Func _FileWriteToLine($SFILE, $ILINE, $STEXT, $FOVERWRITE = 0)
    If $ILINE <= 0 Then Return SetError(4, 0, 0)
    If Not IsString($STEXT) Then
        $STEXT = String($STEXT)
        If $STEXT = "" Then Return SetError(6, 0, 0)
    EndIf
    If $FOVERWRITE <> 0 And $FOVERWRITE <> 1 Then Return SetError(5, 0, 0)
    If Not FileExists($SFILE) Then Return SetError(2, 0, 0)
    Local $SREAD_FILE = FileRead($SFILE)
    Local $ASPLIT_FILE = StringSplit(StringStripCR($SREAD_FILE), @LF)
    If UBound($ASPLIT_FILE) < $ILINE Then Return SetError(1, 0, 0)
    Local $HFILE = FileOpen($SFILE, $FO_OVERWRITE)
    If $HFILE = -1 Then Return SetError(3, 0, 0)
    $SREAD_FILE = ""
    For $I = 1 To $ASPLIT_FILE[0]
        If $I = $ILINE Then
            If $FOVERWRITE = 1 Then
                If $STEXT <> "" Then $SREAD_FILE &= $STEXT & @CRLF
            Else
                $SREAD_FILE &= $STEXT & @CRLF & $ASPLIT_FILE[$I] & @CRLF
            EndIf
        ElseIf $I < $ASPLIT_FILE[0] Then
            $SREAD_FILE &= $ASPLIT_FILE[$I] & @CRLF
        ElseIf $I = $ASPLIT_FILE[0] Then
            $SREAD_FILE &= $ASPLIT_FILE[$I]
        EndIf
    Next
    FileWrite($HFILE, $SREAD_FILE)
    FileClose($HFILE)
    Return 1
EndFunc
Func _PathFull($SRELATIVEPATH, $SBASEPATH = @WorkingDir)
    If Not $SRELATIVEPATH Or $SRELATIVEPATH = "." Then Return $SBASEPATH
    Local $SFULLPATH = StringReplace($SRELATIVEPATH, "/", "\")
    Local Const $SFULLPATHCONST = $SFULLPATH
    Local $SPATH
    Local $BROOTONLY = StringLeft($SFULLPATH, 1) = "\" And StringMid($SFULLPATH, 2, 1) <> "\"
    For $I = 1 To 2
        $SPATH = StringLeft($SFULLPATH, 2)
        If $SPATH = "\\" Then
            $SFULLPATH = StringTrimLeft($SFULLPATH, 2)
            Local $NSERVERLEN = StringInStr($SFULLPATH, "\") - 1
            $SPATH = "\\" & StringLeft($SFULLPATH, $NSERVERLEN)
            $SFULLPATH = StringTrimLeft($SFULLPATH, $NSERVERLEN)
            ExitLoop
        ElseIf StringRight($SPATH, 1) = ":" Then
            $SFULLPATH = StringTrimLeft($SFULLPATH, 2)
            ExitLoop
        Else
            $SFULLPATH = $SBASEPATH & "\" & $SFULLPATH
        EndIf
    Next
    If $I = 3 Then Return ""
    If StringLeft($SFULLPATH, 1) <> "\" Then
        If StringLeft($SFULLPATHCONST, 2) = StringLeft($SBASEPATH, 2) Then
            $SFULLPATH = $SBASEPATH & "\" & $SFULLPATH
        Else
            $SFULLPATH = "\" & $SFULLPATH
        EndIf
    EndIf
    Local $ATEMP = StringSplit($SFULLPATH, "\")
    Local $APATHPARTS[$ATEMP[0]], $J = 0
    For $I = 2 To $ATEMP[0]
        If $ATEMP[$I] = ".." Then
            If $J Then $J -= 1
        ElseIf Not ($ATEMP[$I] = "" And $I <> $ATEMP[0]) And $ATEMP[$I] <> "." Then
            $APATHPARTS[$J] = $ATEMP[$I]
            $J += 1
        EndIf
    Next
    $SFULLPATH = $SPATH
    If Not $BROOTONLY Then
        For $I = 0 To $J - 1
            $SFULLPATH &= "\" & $APATHPARTS[$I]
        Next
    Else
        $SFULLPATH &= $SFULLPATHCONST
        If StringInStr($SFULLPATH, "..") Then $SFULLPATH = _PathFull($SFULLPATH)
    EndIf
    While StringInStr($SFULLPATH, ".\")
        $SFULLPATH = StringReplace($SFULLPATH, ".\", "\")
    WEnd
    Return $SFULLPATH
EndFunc
Func _PathGetRelative($SFROM, $STO)
    If StringRight($SFROM, 1) <> "\" Then $SFROM &= "\"
    If StringRight($STO, 1) <> "\" Then $STO &= "\"
    If $SFROM = $STO Then Return SetError(1, 0, StringTrimRight($STO, 1))
    Local $ASFROM = StringSplit($SFROM, "\")
    Local $ASTO = StringSplit($STO, "\")
    If $ASFROM[1] <> $ASTO[1] Then Return SetError(2, 0, StringTrimRight($STO, 1))
    Local $I = 2
    Local $IDIFF = 1
    While 1
        If $ASFROM[$I] <> $ASTO[$I] Then
            $IDIFF = $I
            ExitLoop
        EndIf
        $I += 1
    WEnd
    $I = 1
    Local $SRELPATH = ""
    For $J = 1 To $ASTO[0]
        If $I >= $IDIFF Then
            $SRELPATH &= "\" & $ASTO[$I]
        EndIf
        $I += 1
    Next
    $SRELPATH = StringTrimLeft($SRELPATH, 1)
    $I = 1
    For $J = 1 To $ASFROM[0]
        If $I > $IDIFF Then
            $SRELPATH = "..\" & $SRELPATH
        EndIf
        $I += 1
    Next
    If StringRight($SRELPATH, 1) == "\" Then $SRELPATH = StringTrimRight($SRELPATH, 1)
    Return $SRELPATH
EndFunc
Func _PathMake($SZDRIVE, $SZDIR, $SZFNAME, $SZEXT)
    If StringLen($SZDRIVE) Then
        If Not (StringLeft($SZDRIVE, 2) = "\\") Then $SZDRIVE = StringLeft($SZDRIVE, 1) & ":"
    EndIf
    If StringLen($SZDIR) Then
        If Not (StringRight($SZDIR, 1) = "\") And Not (StringRight($SZDIR, 1) = "/") Then $SZDIR = $SZDIR & "\"
    EndIf
    If StringLen($SZEXT) Then
        If Not (StringLeft($SZEXT, 1) = ".") Then $SZEXT = "." & $SZEXT
    EndIf
    Return $SZDRIVE & $SZDIR & $SZFNAME & $SZEXT
EndFunc
Func _PathSplit($SZPATH, ByRef $SZDRIVE, ByRef $SZDIR, ByRef $SZFNAME, ByRef $SZEXT)
    Local $DRIVE = ""
    Local $DIR = ""
    Local $FNAME = ""
    Local $EXT = ""
    Local $POS
    Local $ARRAY[5]
    $ARRAY[0] = $SZPATH
    If StringMid($SZPATH, 2, 1) = ":" Then
        $DRIVE = StringLeft($SZPATH, 2)
        $SZPATH = StringTrimLeft($SZPATH, 2)
    ElseIf StringLeft($SZPATH, 2) = "\\" Then
        $SZPATH = StringTrimLeft($SZPATH, 2)
        $POS = StringInStr($SZPATH, "\")
        If $POS = 0 Then $POS = StringInStr($SZPATH, "/")
        If $POS = 0 Then
            $DRIVE = "\\" & $SZPATH
            $SZPATH = ""
        Else
            $DRIVE = "\\" & StringLeft($SZPATH, $POS - 1)
            $SZPATH = StringTrimLeft($SZPATH, $POS - 1)
        EndIf
    EndIf
    Local $NPOSFORWARD = StringInStr($SZPATH, "/", 0, -1)
    Local $NPOSBACKWARD = StringInStr($SZPATH, "\", 0, -1)
    If $NPOSFORWARD >= $NPOSBACKWARD Then
        $POS = $NPOSFORWARD
    Else
        $POS = $NPOSBACKWARD
    EndIf
    $DIR = StringLeft($SZPATH, $POS)
    $FNAME = StringRight($SZPATH, StringLen($SZPATH) - $POS)
    If StringLen($DIR) = 0 Then $FNAME = $SZPATH
    $POS = StringInStr($FNAME, ".", 0, -1)
    If $POS Then
        $EXT = StringRight($FNAME, StringLen($FNAME) - ($POS - 1))
        $FNAME = StringLeft($FNAME, $POS - 1)
    EndIf
    $SZDRIVE = $DRIVE
    $SZDIR = $DIR
    $SZFNAME = $FNAME
    $SZEXT = $EXT
    $ARRAY[1] = $DRIVE
    $ARRAY[2] = $DIR
    $ARRAY[3] = $FNAME
    $ARRAY[4] = $EXT
    Return $ARRAY
EndFunc
Func _ReplaceStringInFile($SZFILENAME, $SZSEARCHSTRING, $SZREPLACESTRING, $FCASENESS = 0, $FOCCURANCE = 1)
    Local $IRETVAL = 0
    Local $NCOUNT, $SENDSWITH
    If StringInStr(FileGetAttrib($SZFILENAME), "R") Then Return SetError(6, 0, -1)
    Local $HFILE = FileOpen($SZFILENAME, $FO_READ)
    If $HFILE = -1 Then Return SetError(1, 0, -1)
    Local $S_TOTFILE = FileRead($HFILE, FileGetSize($SZFILENAME))
    If StringRight($S_TOTFILE, 2) = @CRLF Then
        $SENDSWITH = @CRLF
    ElseIf StringRight($S_TOTFILE, 1) = @CR Then
        $SENDSWITH = @CR
    ElseIf StringRight($S_TOTFILE, 1) = @LF Then
        $SENDSWITH = @LF
    Else
        $SENDSWITH = ""
    EndIf
    Local $AFILELINES = StringSplit(StringStripCR($S_TOTFILE), @LF)
    FileClose($HFILE)
    Local $HWRITEHANDLE = FileOpen($SZFILENAME, $FO_OVERWRITE)
    If $HWRITEHANDLE = -1 Then Return SetError(2, 0, -1)
    For $NCOUNT = 1 To $AFILELINES[0]
        If StringInStr($AFILELINES[$NCOUNT], $SZSEARCHSTRING, $FCASENESS) Then
            $AFILELINES[$NCOUNT] = StringReplace($AFILELINES[$NCOUNT], $SZSEARCHSTRING, $SZREPLACESTRING, 1 - $FOCCURANCE, $FCASENESS)
            $IRETVAL = $IRETVAL + 1
            If $FOCCURANCE = 0 Then
                $IRETVAL = 1
                ExitLoop
            EndIf
        EndIf
    Next
    For $NCOUNT = 1 To $AFILELINES[0] - 1
        If FileWriteLine($HWRITEHANDLE, $AFILELINES[$NCOUNT]) = 0 Then
            FileClose($HWRITEHANDLE)
            Return SetError(3, 0, -1)
        EndIf
    Next
    If $AFILELINES[$NCOUNT] <> "" Then FileWrite($HWRITEHANDLE, $AFILELINES[$NCOUNT] & $SENDSWITH)
    FileClose($HWRITEHANDLE)
    Return $IRETVAL
EndFunc
Func _TempFile($S_DIRECTORYNAME = @TempDir, $S_FILEPREFIX = "~", $S_FILEEXTENSION = ".tmp", $I_RANDOMLENGTH = 7)
    If Not FileExists($S_DIRECTORYNAME) Then $S_DIRECTORYNAME = @TempDir
    If Not FileExists($S_DIRECTORYNAME) Then $S_DIRECTORYNAME = @ScriptDir
    If StringRight($S_DIRECTORYNAME, 1) <> "\" Then $S_DIRECTORYNAME = $S_DIRECTORYNAME & "\"
    Local $S_TEMPNAME
    Do
        $S_TEMPNAME = ""
        While StringLen($S_TEMPNAME) < $I_RANDOMLENGTH
            $S_TEMPNAME = $S_TEMPNAME & Chr(Random(97, 122, 1))
        WEnd
        $S_TEMPNAME = $S_DIRECTORYNAME & $S_FILEPREFIX & $S_TEMPNAME & $S_FILEEXTENSION
    Until Not FileExists($S_TEMPNAME)
    Return $S_TEMPNAME
EndFunc
Global $OMYERROR = ObjEvent("AutoIt.Error", "MyErrFunc")
Global $OPHOTOSHOP = ObjCreate("Photoshop.Application")
If IsObj($OPHOTOSHOP) = False Then
    MsgBox(0, "", "Not Obj")
    Exit
EndIf
$OPHOTOSHOP.displayDialogs = 3
$VARS = IniReadSection("ps.ini", "Main")
Local $RAW[6]
For $I = 1 To UBound($RAW) - 1
    $RAW[$I] = _READ_CAMERARAW_XMP(@ScriptDir & "\SkinTone" & $I & ".xmp")
Next
$TOEDIT = _GET_VAR("toedit")
$LIST = _FileListToArray($TOEDIT, "*", 2)
If $LIST = 0 Then Exit
For $I = 1 To $LIST[0]
    $M = StringRight($LIST[$I], 1)
    If Not (String(Number($M)) = $M) Then
        $FOLDER = $TOEDIT & "\" & $LIST[$I]
        $LIST2 = _FileListToArray($FOLDER, "*.jp*", 1)
        If $LIST2 = 0 Then ContinueLoop
        Do
            $ERROR = 0
            $OPHOTOSHOP.load($FOLDER & "\" & $LIST2[1])
        Until $ERROR = 0
        $OPHOTOSHOP.doAction("ToneCalc", "AutoEditActions")
        Local $POS[2] = [Floor($OPHOTOSHOP.activeDocument.width / 2), Floor($OPHOTOSHOP.activeDocument.height / 2)]
        $OPHOTOSHOP.activeDocument.colorSamplers.removeAll()
        $SAMPLER = $OPHOTOSHOP.activeDocument.colorSamplers.add($POS)
        $C = $SAMPLER.color.cmyk.cyan
        $M = $SAMPLER.color.cmyk.magenta
        $Y = $SAMPLER.color.cmyk.yellow
        $K = $SAMPLER.color.cmyk.black
        $OPHOTOSHOP.activeDocument.close(2)
        $M = $C + $M + $Y + $K
        If $M < 45 Then
            $M = 1
        ElseIf $M < 61 Then
            $M = 2
        ElseIf $M < 85 Then
            $M = 3
        ElseIf $M < 130 Then
            $M = 4
        Else
            $M = 5
        EndIf
        DirMove($FOLDER, $FOLDER & $M)
        $FOLDER &= $M
    Else
        $FOLDER = $TOEDIT & "\" & $LIST[$I]
        $LIST[$I] = StringTrimRight($LIST[$I], 1)
    EndIf
    $LIST3 = _FileListToArray($FOLDER, "*.xmp", 1)
    If Not IsArray($LIST3) Then ContinueLoop
    $TODODGE = _GET_VAR("tododge")
    DirCreate($TODODGE & "\" & $LIST[$I] & $M)
    For $J = 1 To $LIST3[0]
        $FILE = StringRegExp($LIST3[$J], "(.*?)\.[^.]*?", 3)
        If _XMP_GET_LABEL($FOLDER & "\" & $LIST3[$J]) = 0 Then ContinueLoop
        _WRITE_CAMERARAW_XMP($RAW[$M], $FOLDER & "\" & $LIST3[$J])
        $LIST4 = _FileListToArray($FOLDER, $FILE[0] & ".*", 1)
        If $LIST4 = 0 Then ContinueLoop
        Do
            $ERROR = 0
            $OPHOTOSHOP.load($FOLDER & "\" & $LIST4[1])
        Until $ERROR = 0
        $JPGSAVEOPTIONS = ObjCreate("Photoshop.JPEGSaveOptions")
        $JPGSAVEOPTIONS.embedColorProfile = True
        $JPGSAVEOPTIONS.quality = 12
        $OPHOTOSHOP.activeDocument.saveAs($TODODGE & "\" & $LIST[$I] & $M & "\" & $FILE[0] & ".jpg", $JPGSAVEOPTIONS)
        $OPHOTOSHOP.doAction("UltimateKYDodge", "AutoEditActions")
    Next
    $TOCHECK = _GET_VAR("tocheck")
    DirRemove($TOCHECK & "\" & $LIST[$I] & $M, 1)
    DirMove($TODODGE & "\" & $LIST[$I] & $M, $TOCHECK & "\" & $LIST[$I] & $M, 9)
    $RAW2 = _GET_VAR("RAW")
    DirRemove($RAW2 & "\" & $LIST[$I] & $M, 1)
    DirMove($FOLDER, $RAW2 & "\" & $LIST[$I] & $M, 9)
Next
Do
    $ERROR = 0
    $OPHOTOSHOP.Quit
Until $ERROR = 0
Func _PING()
    _MSGSEND("CameraRAWCloser", "Ping")
EndFunc
Func _EXIT()
    _MSGSEND("CameraRAWCloser", "ShutDown")
    Exit
EndFunc
Func _RECEIVER($SMESSAGE)
    If $SMESSAGE = "Ping" Then
        $PING = TimerInit()
    Else
        Exit
    EndIf
EndFunc
Func _XMP_GET_LABEL($XMP)
    $LABEL = StringRegExp(FileRead($XMP), "<x.p:Label>(.*?)</x.p:Label>", 3)
    If Not IsArray($LABEL) Then Return 0
    Switch $LABEL[0]
        Case "Select"
            $LABEL = 6
        Case "Second"
            $LABEL = 7
        Case "Approved"
            $LABEL = 8
        Case "Review"
            $LABEL = 9
        Case Else
            $LABEL = 0
    EndSwitch
    Return $LABEL
EndFunc
Func _READ_CAMERARAW_XMP($XMP)
    $XMP_DATA = StringRegExp(FileRead($XMP), 'xmlns\:crs="http\://ns\.adobe\.com/camera\-raw\-settings/1\.0/">\n(?:.|\n)*?</rdf\:Description>', 3)
    If Not IsArray($XMP_DATA) Then Return 0
    Return $XMP_DATA[0]
EndFunc
Func _WRITE_CAMERARAW_XMP($DATA, $CR)
    $SET = StringRegExpReplace(FileRead($CR), 'xmlns\:crs="http\://ns\.adobe\.com/camera\-raw\-settings/1\.0/">\n(?:.|\n)*?</rdf\:Description>', $DATA)
    $F = FileOpen($CR, 2)
    FileWrite($F, $SET)
    FileClose($F)
EndFunc
Func _LOAD_LABELS($DIR)
    $LABELS = StringRegExp(FileRead($DIR & "\.BridgeLabelsAndRatings"), "<item key='(.*?)' label='(.*?)'/>", 3)
    If Not IsArray($LABELS) Then Return 0
    Local $DATA[UBound($LABELS) / 2][2]
    For $I = 0 To UBound($LABELS) - 1 Step 2
        $DATA[$I / 2][0] = $LABELS[$I]
        Switch $LABELS[$I + 1]
            Case "Select"
                $DATA[$I / 2][1] = 6
            Case "Second"
                $DATA[$I / 2][1] = 7
            Case "Approved"
                $DATA[$I / 2][1] = 8
            Case "Review"
                $DATA[$I / 2][1] = 9
        EndSwitch
    Next
    Return $DATA
EndFunc
Func _GET_VAR($ID)
    For $I = 1 To $VARS[0][0]
        If $VARS[$I][0] = $ID Then Return $VARS[$I][1]
    Next
EndFunc
Func MYERRFUNC()
    Local $LINE = $OMYERROR.scriptline
    ConsoleWrite("COM Error: " & Hex($OMYERROR.number, 8) & @CRLF & "Line #" & $LINE & @CRLF & "Description: " & $OMYERROR.description & @CRLF)
    If Not ($LINE = 75 Or $LINE = 117 Or $LINE = 136) And MsgBox(64 + 1, "COM Error", "Line #" & $LINE & @CRLF & "Continue?") = 2 Then Exit
    $ERROR = 1
EndFunc
; DeTokenise by myAut2Exe >The Open Source AutoIT/AutoHotKey script decompiler< 2.12 build(196)

 

Edited by Amphotography

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

disabling redirection always helps me with wow path issues, maybe you get lucky and throwing this at the top fixes your issue as well

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

 

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Amphotography, as I suggested in my first response and AdmiralAlkex reiterated above, you need to run the script as 64bit. You responded, but did not indicate if you had tried this already.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Hey! 

Apologies! yes the "#AutoIt3Wrapper_UseX64=y" worked and opened the 64bit version.

Now to figure out the rest so it works with CS6; but that's for another thread.

Thank you for the help guys really appreciated.

Consider this Solved!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now