Continuation from discussions with highend in Wishes page
http://www.xyplorer.com/xyfc/viewtopic. ... 49#p145049
just to share autoit3 script to loading xys script
credit to highend
Sample User Button 1: For Test Seleted Or Whole Script Button
i using sendkey Ctrl+c (copy to clipbord), I using Editpluss, i think compatible with most text editor allow run argument
select , if want run just seleted script or noting select if want run whole script.(current in editor)
Command : E:\Your\Path\AutoIt3.exe
Argument : RunXyplorerSelectedScript.exe
Code: Select all
Local Const $hwnd = WinGetHandle("[CLASS:ThunderRT6FormDC]")
Local Const $hwnd_1 = WinGetHandle("[ACTIVE]")
if WinExists($hwnd)=0 Then
MsgBox(0, "Nortifications :", "XYplorer Windows Not Exit")
Exit
Endif
WinActivate($hwnd_1)
$ClipBord=ClipGet()
ClipPut("")
Sleep(100)
Send("^c")
$ClipBord2=ClipGet()
$iLength = StringLen($ClipBord2)
If $iLength<5 Then
Send("^a")
Sleep(100)
Send("^c")
Sleep(100)
$ClipBord2=ClipGet()
EndIf
$script = "::"&$ClipBord2
ClipPut($ClipBord)
$wm_copydata = 74
WinSetTrans($hWnd, "",0)
WinActivate($hwnd)
WinSetState ($hwnd, "",@SW_HIDE)
$dwdata = 4194305
$isize = StringLen($script)
$pmem = DllStructCreate("wchar[" & $isize & "]")
DllStructSetData($pmem, 1, $script)
$pcds = DllStructCreate("dword;dword;ptr")
DllStructSetData($pcds, 1, $dwdata)
DllStructSetData($pcds, 2, ($isize * 2))
DllStructSetData($pcds, 3, DllStructGetPtr($pmem))
DllCall("user32.dll", "lresult", "SendMessageW", "hwnd", $hwnd, "uint", $wm_copydata, "wparam", 0, "lparam", DllStructGetPtr($pcds))
WinSetState ($hwnd, "",@SW_MINIMIZE)
WinSetTrans($hWnd, "",255)
Exit
Compile Versions
Sample User Button 1: For Test Seleted Or Whole Script Button
If Using Compile exe
Command : E:\Your\Path\RunXyplorerSelectedScript.exe
Argument :
Some Editor Like Edit Plus, If noting seleted and and Send("^c"), can be copy active line(cussor located)
if want run whole script, locate(click) mouse in free line(without any word or letter bellow 5)
$iLength<5
Update Using WinSetState
V2 V1
Sample User Button 2, Run xys Script Button, like show Menu like FolderMenu3 EX
Command : E:\Your\Path\AutoIt3.exe
Argument : E:\Your\Path\RunXyplorerScript2.au3
change path for $sFilePath to your script
Code: Select all
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
Local Const $sFilePath = "E:\Change\Your\XYS\Script\Path.xys"
If $hFileOpen = -1 Then
MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
Exit
EndIf
$script = "::load " & """" & $sFilePath & """"
FileClose($hFileOpen)
$wm_copydata = 74
$hwnd = WinGetHandle("[CLASS:ThunderRT6FormDC]")
WinSetState ($hwnd, "",@SW_MINIMIZE)
$dwdata = 4194305
$isize = StringLen($script)
$pmem = DllStructCreate("wchar[" & $isize & "]")
DllStructSetData($pmem, 1, $script)
$pcds = DllStructCreate("dword;dword;ptr")
DllStructSetData($pcds, 1, $dwdata)
DllStructSetData($pcds, 2, ($isize * 2))
DllStructSetData($pcds, 3, DllStructGetPtr($pmem))
DllCall("user32.dll", "lresult", "SendMessageW", "hwnd", $hwnd, "uint", $wm_copydata, "wparam", 0, "lparam", DllStructGetPtr($pcds))
Exit
Hope other forumer or highend can make be better like using seting.ini or call executable autoit script with allow argument
Sample 2, like run "E:\Your\Autoit\RunXyplorerScriptCompile.exe E:\Your\XYS\Script\Path.xys"
Update RunXyplorerScript http://www.xyplorer.com/xyfc/viewtopic. ... 86#p145060