Jump to content
Sign in to follow this  
Wombat

SciTE Resource Manager

Recommended Posts

Wombat

First of all, I would like to thank those who helped me immensely on this script:
 
guinness
Edano
 
and as well thank those who's script's I barrowed from:

Melba23
guinness
BrewManNH
(if i missed anyone I apologize)
I have learned a great deal in a short amount of time, and I certainly couldn't have without the aid of the members of this forum. I've rarely came upon a forum that had such a great community as this, they truly are gems hidden away in the land of internwebs.

I made this (with the help of others, which without it this would be a crap script) to aid me in my work, and I hope it helps you with yours as well. If not then at least it's here to serve as an example for others.
 
ResourceManager.au3 
CODE:


 
#region;;;;;;;;;;;;;;;SciTE Resource Manager;;;;;;;;;;;;;;;;;;;
;;;;;created by Wombat with help from Melba23, guinness, and Edano;;;;;;

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <SendMessage.au3>
#include <Misc.au3>

Opt("GUIOnEventMode", 1)
#NoTrayIcon

#region ;;;GUI starts here;;;;
$hGUI_Main = GUICreate("Resource Manager", 448, 603, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "MainGUIClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$List1 = GUICtrlCreateList("", 0, 0, 446, 565)
$Options = GUICtrlCreateButton("SHOW OPTIONS", 5, 568, 305, 33)
GUICtrlSetOnEvent(-1, "OptionsClick")
$Options = GUICtrlCreateButton("REFRESH", 350, 568, 65, 33)
GUICtrlSetOnEvent(-1, "RefreshClick")
$cDrop_Dummy = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_On_Drop")
Global $aDrop_List
Global $List1Data
GUISetState(@SW_SHOW)
#endregion ;;;;;GUI ends here;;;;;6

#region ;;;These register a user defined function for a known Windows Message ID;;;;
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")


GUIRegisterMsg(0x233, "On_WM_DROPFILES");<--- This is how the GUI registers the dropped files
#endregion ;;;;;;;

#region ;;;This is the startup action that populates the ResourceManager's listbox;;;
Global $List1Data
Global $WinTitle = WinGetTitle('[CLASS:SciTEWindow]')
Local $sFilePath = StringRegExpReplace($WinTitle, '^(\V+)(?:\h[-*]\V+)$', '\1')
_FileReadToArray($sFilePath & "_res.txt", $List1Data)
$ListDef = _ArrayToString($List1Data)
GUICtrlSetData($List1, $ListDef)
#endregion ;;;;;;;;;;;;

While 1
    Sleep(10)
WEnd

#region ;;;;Functions start here;;;;;;
Func MainGUIClose();<---- This exits the script and stops the process
    Exit
EndFunc

Func RefreshClick();<----This refreshs the Resource Manager's ListBox
    GUICtrlSetData($List1, "")
    Local $sFilePath = StringRegExpReplace($WinTitle, '^(\V+)(?:\h[-*]\V+)$', '\1')
    _FileReadToArray($sFilePath & "_res.txt", $List1Data)
    $ListDef = _ArrayToString($List1Data)
    GUICtrlSetData($List1, $ListDef)
EndFunc

Func OptionsClick();<---- This calls up another gui which edits the contents of the resource file
    $hGUI = GUICreate("RM Options", 375, 376, 300, 124, Default, $WS_EX_ACCEPTFILES)
    GUISetOnEvent($GUI_EVENT_CLOSE, "OptionsClose")
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
    GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
    Global $List2 = GUICtrlCreateList("", 0, -1, 283, 381, $LBS_EXTENDEDSEL)
    Global $bDeleteSel = GUICtrlCreateButton("Delete Selection", 285, 40, 89, 33)
    GUICtrlSetOnEvent(-1, "DelSel")
    Global $bClearAll = GUICtrlCreateButton("Clear All", 299, 88, 73, 33)
    GUICtrlSetOnEvent(-1, "ClearAll")
    Global $bGenerate = GUICtrlCreateButton("Generate", 315, 320, 57, 41)
    GUICtrlSetOnEvent(-1, "GenerateProf")
    Global $Label1 = GUICtrlCreateLabel("Edit Resource List", 285, 8, 90, 17)
    Global $Label2 = GUICtrlCreateLabel("Generate", 320, 264, 48, 17)
    Global $Label3 = GUICtrlCreateLabel("Resource Profile", 295, 288, 82, 17)
    Global $cDrop_Dummy = GUICtrlCreateDummy()
    GUICtrlSetOnEvent(-1, "_On_Drop")
    Global $aDrop_List
    GUISetState(@SW_SHOW)
EndFunc


Func _On_Drop() ;<---- This populates the Options Window's ListBox with the items draged&dropped onto it
    For $i = 1 To $aDrop_List[0]
        GUICtrlSetData($List2, $aDrop_List[$i])
    Next
EndFunc   ;==>_On_Drop


Func On_WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam);<---- This is how the GUI registers the dropped files
    ; Credit to ProgAndy for DLL calls
    #forceref $hWnd, $iMsg, $lParam
    Local $iSize, $pFileName
    ; Get number of files dropped
    Local $aRet = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 0)
    ; Reset array to correct size
    Global $aDrop_List[$aRet[0] + 1] = [$aRet[0]]
    ; And add item names
    For $i = 0 To $aRet[0] - 1
        $aRet = DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0)
        $iSize = $aRet[0] + 1
        $pFileName = DllStructCreate("wchar[" & $iSize & "]")
        DllCall("shell32.dll", "int", "DragQueryFileW", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($pFileName), "int", $iSize)
        $aDrop_List[$i + 1] = DllStructGetData($pFileName, 1)
        $pFileName = 0
    Next
    ; Send the count to trigger the drop function in the main loop
    GUICtrlSendToDummy($cDrop_Dummy, $aDrop_List[0])
EndFunc   ;==>On_WM_DROPFILES

Func DelSel();<---- This deletes the item selected in the Options Window ListBox
    Local $a_SelectedItems = _GUICtrlListBox_GetSelItems($List2)
    For $i = $a_SelectedItems[0] To 1 Step -1
        _GUICtrlListBox_DeleteString($List2, $a_SelectedItems[$i])
    Next
EndFunc

Func ClearAll();<---- This clears the contents of the ListBox in the Options Window
    GUICtrlSetData($List2, "")
EndFunc

Func GenerateProf();<---- This creates the resource profile
    $FileCount = _GUICtrlListBox_GetCount($List2)
    $FileList[$FileCount + 1]
    For $i = 0 To $FileCount
        $FileList[$i] = _GUICtrlListBox_GetText($List2, $i)
    Next
    _ArrayDelete($FileList, $i)
    _FileWriteFromArray($sFilePath & "_res.txt", $FileList)
EndFunc

Func OptionsClose();<----This closes the Options Window leaving the MainGUI open !if Exit is used here it will close both windows!
    GUIDelete("RM Options")
EndFunc

Func Form1Minimize()

EndFunc

Func Form1Restore()

EndFunc

Func _SciTE_InsertText($sString);<---- This inserts the item double-clicked in the ListBox in the Resource Manager's window
    $sString = StringReplace($sString, '\', '\\')
    _SciTE_ReplaceMarcos($sString)
    Return _SciTE_Send_Command(0, _SciTE_WinGetDirector(), 'insert:' & $sString)
EndFunc   ;==>_SciTE_InsertText

Func _SciTE_ReplaceMarcos(ByRef $sString)
    $sString = StringReplace($sString, @TAB, '\t')
    $sString = StringReplace($sString, @CR, '\r')
    $sString = StringReplace($sString, @LF, '\n')
EndFunc   ;==>_SciTE_ReplaceMarcos

Func _SciTE_WinGetDirector()
    Return WinGetHandle('DirectorExtension')
EndFunc   ;==>_SciTE_WinGetDirector

Func _SciTE_Send_Command($hHandle, $hSciTE, $sString)
    Local $ilParam, $tData
    If StringStripWS($sString, 8) = "" Then
        Return SetError(2, 0, 0) ; String is blank.
    EndIf
    $sString = ":" & Dec(StringTrimLeft($hHandle, 2)) & ":" & $sString
    $tData = DllStructCreate("char[" & StringLen($sString) + 1 & "]") ; wchar
    DllStructSetData($tData, 1, $sString)
    $ilParam = DllStructCreate("ptr;dword;ptr") ; ulong_ptr;dword;ptr
    DllStructSetData($ilParam, 1, 1) ; $ilParam, 1, 1
    DllStructSetData($ilParam, 2, DllStructGetSize($tData))
    DllStructSetData($ilParam, 3, DllStructGetPtr($tData))
    _SendMessage($hSciTE, $WM_COPYDATA, $hHandle, DllStructGetPtr($ilParam))
    Return Number(Not @error)
EndFunc   ;==>_SciTE_Send_Command

Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam);<---- This reads the item that is double-clicked in the ListBox in the Resource Manager's window

    #forceref $hWnd, $iMsg, $lParam

    $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word
    $iCode = BitShift($wParam, 16) ; Hi Word

    Switch $iCode
        Case $LBN_DBLCLK
            Switch $iIDFrom
                Case $List1
                    $QMark= Chr(34)
                    $sData = GUICtrlRead($List1) ; Use the native function

                    _SciTE_InsertText($QMark & $sData & $QMark)
            EndSwitch
    EndSwitch

EndFunc
#endregion ;;;;;Functions End Here;;;;;

#endregion


 
Installation:
 


[1] acquire the script through either downloading it or copy/paste/save
[2] compile the script as ResourceManager
[3] navigate to the folder that holds your SciTE installation (the one that contains the SciTE.exe)
[4] create a new folder called "ResourceManager" and place the ResourceManager.exe inside this new folder
[5] locate the SciTEGlobal.properties file
[6] add this code to the very bottom of the file (with notepad, notepad++, etc.)
# 44 Resource Manager
command.name.44.*=Resource Manager
command.44.*="$(SciteDefaultHome)\ResourceManager\ResourceManager.exe" $(CurrentSelection)
command.shortcut.44.*=Ctrl+Alt+R

[7]restart SciTE and you should see the newentry inside of "Tools"


 
post-79839-0-95548400-1376011387_thumb.p
 
post-79839-0-64761400-1376011386_thumb.p
 
Description:

This tool is used to create a yourscriptname_res.txt file that is associated with your script. This file contains the file paths of all the resources you plan to use in your script for easy access and insertion.
 
 
Usage Instructions:
 


Open the ResourceManager by either clicking on Tools and navigating to ResourceManager or by pressing Ctrl+Alt+R

Press the "SHOW OPTIONS" button to bring up the profile generator.

 
Drag and drop all the files you plan to include in your script onto this window, upon doing so the listbox should populate with the contents you dropped on it. Review the contents and remove any unwated files with the "Delete Selection" button or clear the list and start over with the "Clear All" button.

Once the generator window contains the files you wanna use, press generate, then close the options window and press the REFRESH button on the ResourceManager window.

Now, once you are at a place in your script that you need to insert a filepath, you can simply double-click the item in the ResourceManager and it will add it to the script for you.

 


 
Tips & Pointers:
 


You must keep the "_res.txt" file in the same folder as the script it was made for or it will not be read.
 
To create a new "_res.txt" file you must use the generator with atleast one entry
 
This has been bug tested on Windows XP Professional SP3 32bits, and on Windows 7 Ultimate x64
without any bugs showing up yet / though this does not mean you wont encounter any, and if you do please report them here or to me via pm.

This script is provided as is and with no guarantees, I plan to update it as I get the chance to but I make no promises regarding its use nor do I offer any reperations if it blows up your chihuahua or excites your grandmother... You agree you will not seek reperations from the creator by downloading/copying&pasting said script.


 
Changes I Want to Include in An Update:
 


Add a system that auto-groups the items in the main GUI by filetype

Add a system that provides previews of the files (images show in a hint, other files such as .txt, .ini, etc show in a tooltip)
 
Set the Options/Generator window to allow direct editing of the _res.txt file so that you don't have to generate a new file every time
 
Add a system that will bake me cookies when I have spent too much time in SciTE... I wish :D

Update: ResourceManager_v2 (a seperate version, see below)
 

Here's an alternate version that runs from a "Resources" file:
 
CODE:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <SendMessage.au3>
#include <Misc.au3>
#include <_RecFileListToArray.au3>
Opt("GUIOnEventMode", 1)
#NoTrayIcon
#region ;;;GUI starts here;;;;
$hGUI_Main = GUICreate("Resource Manager", 448, 603, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "MainGUIClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$List1 = GUICtrlCreateList("", 0, 0, 446, 565)
$Options = GUICtrlCreateButton("SETTINGS", 5, 568, 305, 33)
GUICtrlSetOnEvent(-1, "OptionsClick")
$Options = GUICtrlCreateButton("REFRESH", 350, 568, 65, 33)
GUICtrlSetOnEvent(-1, "RefreshClick")
Global $QMark = Chr(34)
Global $ResFileDir = @ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt"
Global $DefPath
Global $List1Data
GUISetState(@SW_SHOW)
#endregion ;;;GUI starts here;;;;
;Dbl Clk read/insert;;;;;;;;;;;;;;;;;;;;;;
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

DirCreate(@ProgramFilesDir & "\Autoit3\Resources\")
If Not FileExists(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt") Then
 Do
  FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", @ProgramFilesDir & "\Autoit3\Resources\")
 Until FileExists(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt")
EndIf
If Not FileExists(@ProgramFilesDir & "\Autoit3\Resources\Example.txt") Then
 Do
  FileWrite(@ProgramFilesDir & "\Autoit3\Resources\Example.txt", "This is an example")
 Until FileExists(@ProgramFilesDir & "\Autoit3\Resources\Example.txt")
EndIf
Sleep(10)
$DefPath = FileRead($ResFileDir)
$aRes = _RecFileListToArray($DefPath, "*", 1, 0, 0, 2)
$ListDef = _ArrayToString($aRes)
GUICtrlSetData($List1, $ListDef)

While 1
 Sleep(10)
WEnd
Func MainGUIClose()
 Exit
EndFunc   ;==>MainGUIClose
Func RefreshClick()
 GUICtrlSetData($List1, "")
 $DefPath = FileRead($ResFileDir)
 $aRes = _RecFileListToArray($DefPath, "*", 1, 0, 0, 2)
 $ListDef = _ArrayToString($aRes)
 GUICtrlSetData($List1, $ListDef)
EndFunc   ;==>RefreshClick
Func OptionsClick()
 Global $Options = GUICreate("Settings", 302, 99, 192, 124)
 GUISetOnEvent($GUI_EVENT_CLOSE, "OptionsClose")
 Global $Label1 = GUICtrlCreateLabel("Default Resource Folder:", 24, 8, 200, 17)
 Global $Button1 = GUICtrlCreateButton("Default", 24, 64, 73, 25)
 GUICtrlSetOnEvent(-1, "OptionsButton1Click")
 Global $Button2 = GUICtrlCreateButton("...", 112, 64, 33, 25)
 GUICtrlSetOnEvent(-1, "OptionsButton2Click")
 Global $Input1 = GUICtrlCreateInput($DefPath, 24, 32, 257, 21, 0x0800)
 GUICtrlSetOnEvent(-1, "OptionsInput1Change")
 GUISetState(@SW_SHOW)
EndFunc   ;==>OptionsClick
#region ;;;;Options Functions begin here;;;;;
Func OptionsClose()
 GUIDelete("RM Options")
 RefreshClick()
EndFunc   ;==>OptionsClose
Func OptionsButton1Click()
 FileDelete($ResFileDir)
 Sleep(10)
 FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", @ProgramFilesDir & "\Autoit3\Resources\")
 GUICtrlSetData($Input1, "")
 Sleep(5)
 Global $DefPath = FileRead($ResFileDir)
 GUICtrlSetData($Input1, $DefPath)
 ToolTip("Your Resource File Has Been Reset", Default, Default, "ResourceManager_v2")
 Sleep(750)
 ToolTip("")
EndFunc   ;==>OptionsButton1Click
Func OptionsButton2Click()
 Local $NewPath = FileSelectFolder("Choose A File", "C:\", 7)
 If IsString($NewPath) Then
  FileDelete($ResFileDir)
  FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", $NewPath)
  GUICtrlSetData($Input1, $NewPath)
  ToolTip("Your Resource File Has Been Changed To:" & $NewPath, Default, Default, "ResourceManager_v2")
  Sleep(750)
  ToolTip("")
 EndIf
EndFunc   ;==>OptionsButton2Click
Func OptionsInput1Change()
EndFunc   ;==>OptionsInput1Change
Func Form1Minimize()
EndFunc   ;==>Form1Minimize
Func Form1Restore()
EndFunc   ;==>Form1Restore
;Insert Dbl Clkd String into SciTE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Func _SciTE_InsertText($sString)
 $sString = StringReplace($sString, '\', '\\')
 _SciTE_ReplaceMarcos($sString)
 Return _SciTE_Send_Command(0, _SciTE_WinGetDirector(), 'insert:' & $sString)
EndFunc   ;==>_SciTE_InsertText
Func _SciTE_ReplaceMarcos(ByRef $sString)
 $sString = StringReplace($sString, @TAB, '\t')
 $sString = StringReplace($sString, @CR, '\r')
 $sString = StringReplace($sString, @LF, '\n')
EndFunc   ;==>_SciTE_ReplaceMarcos
Func _SciTE_WinGetDirector()
 Return WinGetHandle('DirectorExtension')
EndFunc   ;==>_SciTE_WinGetDirector
Func _SciTE_Send_Command($hHandle, $hSciTE, $sString)
 Local $ilParam, $tData
 If StringStripWS($sString, 8) = "" Then
  Return SetError(2, 0, 0) ; String is blank.
 EndIf
 $sString = ":" & Dec(StringTrimLeft($hHandle, 2)) & ":" & $sString
 $tData = DllStructCreate("char[" & StringLen($sString) + 1 & "]") ; wchar
 DllStructSetData($tData, 1, $sString)
 $ilParam = DllStructCreate("ptr;dword;ptr") ; ulong_ptr;dword;ptr
 DllStructSetData($ilParam, 1, 1) ; $ilParam, 1, 1
 DllStructSetData($ilParam, 2, DllStructGetSize($tData))
 DllStructSetData($ilParam, 3, DllStructGetPtr($tData))
 _SendMessage($hSciTE, $WM_COPYDATA, $hHandle, DllStructGetPtr($ilParam))
 Return Number(Not @error)
EndFunc   ;==>_SciTE_Send_Command
#endregion ;;;;Options Functions begin here;;;;;
;;;;dbl click read;;;
Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
 #forceref $hWnd, $iMsg, $lParam
 $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word
 $iCode = BitShift($wParam, 16) ; Hi Word
 Switch $iCode
  Case $LBN_DBLCLK
   Switch $iIDFrom
    Case $List1
     $sData = GUICtrlRead($List1) ; Use the native function
     _SciTE_InsertText($QMark & $sData & $QMark)
   EndSwitch
 EndSwitch
EndFunc   ;==>_WM_COMMAND


 
You must create a folder named "ResourceManager_v2" in your "Autoit3" folder, also it assumes that the "Autoit3" folder is in your "Program FIles" folder.
 
If it isn't then for now you'll need to change the $ResFileDir variable and all it's occurences to match, UNTIL I update it to find your "Autoit3" folder wherever it is... likely easy peasy but I'm tired and need sleep.
 
This version gives the user the ability to set their own resource file as well in the settings dialogue...
 
ENJOY!

Thank you all,
Wombat

Edited by Wombat
  • Like 1

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites
Edano

wombat take a look at your other script i fixed it :)

  • Like 1

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
mLipok

Is the report you can add the output of these three functions

FileGetSize
FileGetTime
FileGetVersion

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library
 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites
Wombat

 

Is the report you can add the output of these three functions

FileGetSize
FileGetTime
FileGetVersion

 

 

to the items in the list? or to the script active in SciTE?

also I understand english is not the primary language of most no this forum, so let me apologize upfront, but what do you mean by "report", again I apologize for having trouble understanding what you mean.

 

Edited by Wombat

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites
Wombat

Quick Update:

Cleaned up the code in the first post, it's edited to provide information for beginners (like myself) that need to know what items in the code do.


Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites
guinness

A couple of updates for you to  consider...

#include <Constants.au3>
#include <SendMessage.au3>
#include <WindowsConstants.au3>

Func _SciTE_Send_Command($hWnd, $hSciTE, $sString)
    If StringStripWS($sString, $STR_STRIPALL) = '' Then
        Return SetError(2, 0, 0) ; String is blank.
    EndIf
    $sString = ':' & Dec(StringTrimLeft($hWnd, 2)) & ':' & $sString
    Local $tData = DllStructCreate('char[' & StringLen($sString) + 1 & ']') ; wchar
    DllStructSetData($tData, 1, $sString)

    Local Const $tagCOPYDATASTRUCT = 'ptr;dword;ptr' ; ';ulong_ptr;dword;ptr'
    Local $tCOPYDATASTRUCT = DllStructCreate($tagCOPYDATASTRUCT)
    DllStructSetData($tCOPYDATASTRUCT, 1, 1)
    DllStructSetData($tCOPYDATASTRUCT, 2, DllStructGetSize($tData))
    DllStructSetData($tCOPYDATASTRUCT, 3, DllStructGetPtr($tData))
    _SendMessage($hSciTE, $WM_COPYDATA, $hWnd, DllStructGetPtr($tCOPYDATASTRUCT))
    Return Number(Not @error)
EndFunc   ;==>_SciTE_Send_Command
Func GenerateProf()
    $FileCount = _GUICtrlListBox_GetCount($List2)
    If $FileCount Then ; If there are items in the ListView then generate the file.
        Global $FileList[$FileCount + 1]
        For $i = 0 To $FileCount
            $FileList[$i] = _GUICtrlListBox_GetText($List2, $i)
        Next
        _ArrayDelete($FileList, $i)
        _FileWriteFromArray($sFilePath & "_res.txt", $FileList)
    EndIf
EndFunc   ;==>GenerateProf
; Place at the top of your script. This is if you're using WinAPIEx or the AutoIt betas (v3.3.9.4+)
#include <APIConstants.au3>
#include <WinAPIEx.au3>

Global $__aDropFiles = 0

; Then use this function.
Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $lParam
    Switch $iMsg
        Case $WM_DROPFILES
            Local Const $aReturn = _WinAPI_DragQueryFileEx($wParam)
            If UBound($aReturn) Then
                $__aGUIDropFiles = $aReturn
            Else
                Local Const $aError[1] = [0]
                $__aGUIDropFiles = $aError
            EndIf
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_DROPFILES

; And create an event for your GUI to monitor $GUI_EVENT_DROPPED.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
guinness

Also declaring Global variables in functions is not a good idea, unless you know what the consequences really are. It's best to declare Global variables at the start of your script.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Wombat

Also declaring Global variables in functions is not a good idea, unless you know what the consequences really are. It's best to declare Global variables at the start of your script.

 

I try to do this when possible, the functions that contain Global variables are from the scripts I borrowed from. Except for the options window which is called up via the options button ( i know this can be done by simply defining the options ctrls and gui then just having the function call it to show.

In my next update this will likely be changed. I saw your Autoit best coding practices and am studying it closely.


Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites
Wombat

 

A couple of updates for you to  consider...

#include <Constants.au3>
#include <SendMessage.au3>
#include <WindowsConstants.au3>

Func _SciTE_Send_Command($hWnd, $hSciTE, $sString)
    If StringStripWS($sString, $STR_STRIPALL) = '' Then
        Return SetError(2, 0, 0) ; String is blank.
    EndIf
    $sString = ':' & Dec(StringTrimLeft($hWnd, 2)) & ':' & $sString
    Local $tData = DllStructCreate('char[' & StringLen($sString) + 1 & ']') ; wchar
    DllStructSetData($tData, 1, $sString)

    Local Const $tagCOPYDATASTRUCT = 'ptr;dword;ptr' ; ';ulong_ptr;dword;ptr'
    Local $tCOPYDATASTRUCT = DllStructCreate($tagCOPYDATASTRUCT)
    DllStructSetData($tCOPYDATASTRUCT, 1, 1)
    DllStructSetData($tCOPYDATASTRUCT, 2, DllStructGetSize($tData))
    DllStructSetData($tCOPYDATASTRUCT, 3, DllStructGetPtr($tData))
    _SendMessage($hSciTE, $WM_COPYDATA, $hWnd, DllStructGetPtr($tCOPYDATASTRUCT))
    Return Number(Not @error)
EndFunc   ;==>_SciTE_Send_Command
Func GenerateProf()
    $FileCount = _GUICtrlListBox_GetCount($List2)
    If $FileCount Then ; If there are items in the ListView then generate the file.
        Global $FileList[$FileCount + 1]
        For $i = 0 To $FileCount
            $FileList[$i] = _GUICtrlListBox_GetText($List2, $i)
        Next
        _ArrayDelete($FileList, $i)
        _FileWriteFromArray($sFilePath & "_res.txt", $FileList)
    EndIf
EndFunc   ;==>GenerateProf

added, will be in the next update, thank you

; Place at the top of your script. This is if you're using WinAPIEx or the AutoIt betas (v3.3.9.4+)
#include <APIConstants.au3>
#include <WinAPIEx.au3>

Global $__aDropFiles = 0

; Then use this function.
Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $lParam
    Switch $iMsg
        Case $WM_DROPFILES
            Local Const $aReturn = _WinAPI_DragQueryFileEx($wParam)
            If UBound($aReturn) Then
                $__aGUIDropFiles = $aReturn
            Else
                Local Const $aError[1] = [0]
                $__aGUIDropFiles = $aError
            EndIf
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_DROPFILES

; And create an event for your GUI to monitor $GUI_EVENT_DROPPED.

 

I dont have WinAPIEx.au3, I will be making a version of the script that uses it but I plan to keep both for those that don't have iteither.

Edited by Wombat

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites
guinness

Don't overcomplicate yourself, if you don't use it then fine. Just remember that when the beta versions hit stable, then my code will be valid for all.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
Edano

wombat, you opened two threads with the same title (SciTE Resource Manager), one in help and one in example scripts. could you reword one of them, because i follow both and cannot distinguish them ;) thx E.


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
Wombat

wombat, you opened two threads with the same title (SciTE Resource Manager), one in help and one in example scripts. could you reword one of them, because i follow both and cannot distinguish them ;) thx E.

 

Not sure I can.. if so, I definitely tried and failed


Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites
Wombat

Here's an alternate version that runs from a "Resources" file:
 
CODE:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>
#include <SendMessage.au3>
#include <Misc.au3>
#include <_RecFileListToArray.au3>

Opt("GUIOnEventMode", 1)
#NoTrayIcon
#region ;;;GUI starts here;;;;
$hGUI_Main = GUICreate("Resource Manager", 448, 603, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "MainGUIClose")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$List1 = GUICtrlCreateList("", 0, 0, 446, 565)
$Options = GUICtrlCreateButton("SETTINGS", 5, 568, 305, 33)
GUICtrlSetOnEvent(-1, "OptionsClick")
$Options = GUICtrlCreateButton("REFRESH", 350, 568, 65, 33)
GUICtrlSetOnEvent(-1, "RefreshClick")
Global $QMark = Chr(34)
Global $ResFileDir = @ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt"
Global $DefPath
Global $List1Data
GUISetState(@SW_SHOW)
#endregion ;;;GUI starts here;;;;

;Dbl Clk read/insert;;;;;;;;;;;;;;;;;;;;;;
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


DirCreate(@ProgramFilesDir & "\Autoit3\Resources\")

If Not FileExists(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt") Then
    Do
        FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", @ProgramFilesDir & "\Autoit3\Resources\")
    Until FileExists(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt")
EndIf

If Not FileExists(@ProgramFilesDir & "\Autoit3\Resources\Example.txt") Then
    Do
        FileWrite(@ProgramFilesDir & "\Autoit3\Resources\Example.txt", "This is an example")
    Until FileExists(@ProgramFilesDir & "\Autoit3\Resources\Example.txt")
EndIf

Sleep(10)

$DefPath = FileRead($ResFileDir)
$aRes = _RecFileListToArray($DefPath, "*", 1, 0, 0, 2)
$ListDef = _ArrayToString($aRes)
GUICtrlSetData($List1, $ListDef)


While 1
    Sleep(10)
WEnd

Func MainGUIClose()
    Exit
EndFunc   ;==>MainGUIClose

Func RefreshClick()
    GUICtrlSetData($List1, "")
    $DefPath = FileRead($ResFileDir)
    $aRes = _RecFileListToArray($DefPath, "*", 1, 0, 0, 2)
    $ListDef = _ArrayToString($aRes)
    GUICtrlSetData($List1, $ListDef)
EndFunc   ;==>RefreshClick

Func OptionsClick()
    Global $Options = GUICreate("Settings", 302, 99, 192, 124)
    GUISetOnEvent($GUI_EVENT_CLOSE, "OptionsClose")
    Global $Label1 = GUICtrlCreateLabel("Default Resource Folder:", 24, 8, 200, 17)
    Global $Button1 = GUICtrlCreateButton("Default", 24, 64, 73, 25)
    GUICtrlSetOnEvent(-1, "OptionsButton1Click")
    Global $Button2 = GUICtrlCreateButton("...", 112, 64, 33, 25)
    GUICtrlSetOnEvent(-1, "OptionsButton2Click")
    Global $Input1 = GUICtrlCreateInput($DefPath, 24, 32, 257, 21, 0x0800)
    GUICtrlSetOnEvent(-1, "OptionsInput1Change")
    GUISetState(@SW_SHOW)
EndFunc   ;==>OptionsClick

#region ;;;;Options Functions begin here;;;;;
Func OptionsClose()
    GUIDelete("RM Options")
    RefreshClick()
EndFunc   ;==>OptionsClose

Func OptionsButton1Click()
    FileDelete($ResFileDir)
    Sleep(10)
    FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", @ProgramFilesDir & "\Autoit3\Resources\")
    GUICtrlSetData($Input1, "")
    Sleep(5)
    Global $DefPath = FileRead($ResFileDir)
    GUICtrlSetData($Input1, $DefPath)
    ToolTip("Your Resource File Has Been Reset", Default, Default, "ResourceManager_v2")
    Sleep(750)
    ToolTip("")
EndFunc   ;==>OptionsButton1Click

Func OptionsButton2Click()
    Local $NewPath = FileSelectFolder("Choose A File", "C:\", 7)
    If IsString($NewPath) Then
        FileDelete($ResFileDir)
        FileWrite(@ProgramFilesDir & "\Autoit3\ResourceManager_v2\ResFileDir.txt", $NewPath)
        GUICtrlSetData($Input1, $NewPath)
        ToolTip("Your Resource File Has Been Changed To:" & $NewPath, Default, Default, "ResourceManager_v2")
        Sleep(750)
        ToolTip("")
    EndIf
EndFunc   ;==>OptionsButton2Click

Func OptionsInput1Change()

EndFunc   ;==>OptionsInput1Change

Func Form1Minimize()

EndFunc   ;==>Form1Minimize

Func Form1Restore()

EndFunc   ;==>Form1Restore

;Insert Dbl Clkd String into SciTE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Func _SciTE_InsertText($sString)
    $sString = StringReplace($sString, '\', '\\')
    _SciTE_ReplaceMarcos($sString)
    Return _SciTE_Send_Command(0, _SciTE_WinGetDirector(), 'insert:' & $sString)
EndFunc   ;==>_SciTE_InsertText

Func _SciTE_ReplaceMarcos(ByRef $sString)
    $sString = StringReplace($sString, @TAB, '\t')
    $sString = StringReplace($sString, @CR, '\r')
    $sString = StringReplace($sString, @LF, '\n')
EndFunc   ;==>_SciTE_ReplaceMarcos

Func _SciTE_WinGetDirector()
    Return WinGetHandle('DirectorExtension')
EndFunc   ;==>_SciTE_WinGetDirector

Func _SciTE_Send_Command($hHandle, $hSciTE, $sString)
    Local $ilParam, $tData
    If StringStripWS($sString, 8) = "" Then
        Return SetError(2, 0, 0) ; String is blank.
    EndIf
    $sString = ":" & Dec(StringTrimLeft($hHandle, 2)) & ":" & $sString
    $tData = DllStructCreate("char[" & StringLen($sString) + 1 & "]") ; wchar
    DllStructSetData($tData, 1, $sString)
    $ilParam = DllStructCreate("ptr;dword;ptr") ; ulong_ptr;dword;ptr
    DllStructSetData($ilParam, 1, 1) ; $ilParam, 1, 1
    DllStructSetData($ilParam, 2, DllStructGetSize($tData))
    DllStructSetData($ilParam, 3, DllStructGetPtr($tData))
    _SendMessage($hSciTE, $WM_COPYDATA, $hHandle, DllStructGetPtr($ilParam))
    Return Number(Not @error)
EndFunc   ;==>_SciTE_Send_Command
#endregion ;;;;Options Functions begin here;;;;;

;;;;dbl click read;;;
Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)

    #forceref $hWnd, $iMsg, $lParam

    $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word
    $iCode = BitShift($wParam, 16) ; Hi Word

    Switch $iCode
        Case $LBN_DBLCLK
            Switch $iIDFrom
                Case $List1
                    $sData = GUICtrlRead($List1) ; Use the native function

                    _SciTE_InsertText($QMark & $sData & $QMark)
            EndSwitch
    EndSwitch

EndFunc   ;==>_WM_COMMAND


 
You must create a folder named "ResourceManager_v2" in your "Autoit3" folder, also it assumes that the "Autoit3" folder is in your "Program FIles" folder.
 
If it isn't then for now you'll need to change the $ResFileDir variable and all it's occurences to match, UNTIL I update it to find your "Autoit3" folder wherever it is... likely easy peasy but I'm tired and need sleep.
 
This version gives the user the ability to set their own resource file as well in the settings dialogue...
 
ENJOY!
 
Updated the first post as well


Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

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
Sign in to follow this  

  • Similar Content

    • ademon
      By ademon
      Hi. I can open the editor with out problems but I can not compile because it is placed on another partition diferent from C.
      Can you provide an update of this bug?


    • Myicq
      By Myicq
      This may be a dumb question.. but my vertical screen space is fairly limited. I don't need (always) to see all the debug output from autoIT compiler, wrapper etc.
      Can I turn this part off: (optionally)
      >"D:\AutoIt3\SciTE\..\AutoIt3.exe" "D:\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\temp\xx.au3" +>11:35:44 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0 Keyboard:00000406 OS:WIN_7/Service Pack 1 CPU:X64 OS:X86 Environment(Language:0406) +> SciTEDir => D:\AutoIt3\SciTE UserDir => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\XXX\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.12.0) from:D:\AutoIt3 input:D:\temp\XX.au3 +>11:35:44 AU3Check ended.rc:0 >Running:(3.3.12.0):D:\AutoIt3\autoit3.exe "D:\temp\xx.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop  
    • BugFix
      By BugFix
      This lua script gives you the ability, to search for selected text or word from cursor in an search engine or on an search site of your choice.You can select the engine/site from a list, that you have defined in your user properties.
      To get the right call for your search engine, open the engine and search for one word. You need the url without the searched word. Write to your properties an display name for this engine and, separated by a comma, the url. See my example in the script header.
      For the list with  search sites, you need display name and site address (without http://).
      It will searched for the full selected text or, if none selection exists, for the word touched by the cursor. You can allow in the properties, that also will recognized words with dots (like objVar.Property).
      The script uses the shell.dll. But if you don't have installed it, the browser will opened with an command line call. Thats why the command window will pop up for a short moment.
      You'll find details for installation and key bindings inside the script. Look for free command numbers in SciTE. By default installation, the numbers must be greater than 35 (max. 49).
      -- TIME_STAMP 2018-09-02 09:22:03 --[[ This script publicates two functions - InetSearch.Engine() You can search for the selected/touched text in SciTE and can select a search engine of your choice. - InetSearch.Site() You can search for the selected/touched text in SciTE with a defined search engine and can select a search site of your choice. Copy this script in your Lua scripts folder. Load this file in the Lua startup: dofile("Full\\Path\\InetSearch.lua") Add in "SciTEUser.properties" the following properties with search engines and search sites of your choice: #~ Inet Search Settings #~ List of engines. "display-name,search-url" (if not set: google.com will used) #~ If only one entry exists, the selection box will not shown. Inet.Search.Engines= \ Google,https://www.google.de/search?q=| \ MetaGer,https://metager.de/meta/meta.ger3?focus=web&eingabe=| \ Bing,https://www.bing.com/search?q=| \ Ask,https://de.ask.com/web?q=| \ Yandex,https://www.yandex.com/search/?text= #~ Engine for site based search #~ Use display name from engines list (if not set: google.com will used) Inet.Search.SearchOnSite.Engine=Google #~ List of sites for site based search. "display-name,site-url" #~ If not set, it searches without a special site. #~ If only one entry exists, the selection box will not shown. Inet.Search.SearchOnSite.Sites= \ AutoIt DE,autoit.de| \ AutoIt EN,autoitscript.com| \ MSDN,msdn.microsoft.com #~ By default, words will detected without dots. (0) #~ You can allow dots, to detect object variables with properties or methods too. Inet.Search.Allow.Punctuation=1 #~ Search commands #~ Search word from cursor with engine selection command.name.9.*=Search with engine selection command.9.*=dostring InetSearch.Engine() command.mode.9.*=subsystem:lua,savebefore:no command.shortcut.9.*=Ctrl+Shift+F8 #~ Search word from cursor with search site selection command.name.5.*=Search with site selection command.5.*=dostring InetSearch.Site() command.mode.5.*=subsystem:lua,savebefore:no command.shortcut.5.*=Ctrl+Shift+F9 --]] InetSearch = {} InetSearch.Handler = EventClass:new(Common) do ------------------------------------------------------------------------------------------------ local engineFallback = "Google,https://www.google.com/search?q=" -- default search engine: "display-name,search-url" local search_type = nil local engine_url = nil local search_item = nil local search_site = nil local tableSelection = nil local list_type = 16 ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------- Load library protected local require_protected = function(_lib) local loaded_lib if pcall(function() loaded_lib = require(_lib) end) then return loaded_lib else return nil end end --> require_protected ------------------------------------------------------------------------------------------------ local shell = require_protected("shell") -- loads the shell library if exists ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Starts the search local RunSearch = function(_item, _url, _site) local sSite = '' if _site ~= nil then sSite = "%20site:".._site end local sCmd = _url.._item..sSite if shell then shell.exec(sCmd) else os.execute('start "" "'..sCmd..'"') end end --> RunSearch ------------------------------------------------------------------------------------------------ ----------------------------------------------------------------------------- Show the user list local ShowSelectionList = function() -- create the selection list (display names from engines or sites) local sep, list = '_', tableSelection[1][1] for i = 2, #tableSelection do list = list..sep..tableSelection[i][1] end local sep_tmp = editor.AutoCSeparator editor.AutoCSeparator = string.byte(sep) editor:UserListShow(list_type, list) editor.AutoCSeparator = sep_tmp end --> ShowSelectionList ------------------------------------------------------------------------------------------------ --------------------------------------------------------------------------- Select the user list function InetSearch.Handler:OnUserListSelection(_tp, _sel) if _tp == list_type then local url for i = 1, #tableSelection do if tableSelection[i][1] == _sel then url = tableSelection[i][2] break end end if search_type == 'site' then search_site = url else search_site = nil engine_url = url end RunSearch(search_item, engine_url, search_site) end end ------------------------------------------------------------------------------------------------ --------------------------------------------------------- List of search engines from properties local GetEngines = function() local sEngines = props['Inet.Search.Engines'] -- without settings, the default search engine will used if sEngines == '' then sEngines = engineFallback end local tEngines = {} for entry in sEngines:gmatch('([^|]+)|-') do for name, url in entry:gmatch('([^,]+),(.+)') do table.insert(tEngines, {name, url}) end end return tEngines end --> GetEngines ------------------------------------------------------------------------------------------------ ----------------------------------------------------------- List of search sites from properties local GetSearchSites = function() local sSites = props['Inet.Search.SearchOnSite.Sites'] if sSites == '' then return nil end local tSites = {} for entry in sSites:gmatch('([^|]+)|-') do for name, url in entry:gmatch('([^,]+),(.+)') do table.insert(tSites, {name, url}) end end return tSites end --> GetSearchSites ------------------------------------------------------------------------------------------------ -------------------------------------------------------------------------------- Get search item local GetSearchItem = function() local sSelect = editor:GetSelText() if sSelect ~= '' then return sSelect end local allowDots = false if props['Inet.Search.Allow.Punctuation'] == '1' then allowDots = true end local caret = editor.CurrentPos local iLine = editor:LineFromPosition(caret) local iZero = editor:PositionFromLine(iLine) editor:LineEnd() local iLineEnd = editor.CurrentPos editor.CurrentPos = caret editor:SetSelection(caret,caret) local iStart = editor:WordStartPosition(caret) if allowDots then while iStart > iZero and editor:textrange(iStart -1, iStart) == '.' do iStart = editor:WordStartPosition(iStart -1) end end local iEnd = editor:WordEndPosition(caret) if allowDots then while iEnd < iLineEnd and editor:textrange(iEnd, iEnd +1) == '.' do iEnd = editor:WordEndPosition(iEnd +1) end end sSelect = editor:textrange(iStart, iEnd):gsub('^([^%w]+)', ''):gsub('([^%w]+)$', '') return sSelect end --> GetSearchItem ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------- Search with engine selection local SearchEngineBased = function() search_type = 'engine' search_item = GetSearchItem() if search_item == '' then return nil end tableSelection = GetEngines() -- only one entry: selection box will not shown if #tableSelection == 1 then RunSearch(search_item, tableSelection[1][2], nil) else ShowSelectionList() end end --> SearchEngineBased ------------------------------------------------------------------------------------------------ -------------------------------------------------------------- Search with search site selection local SearchSiteBased = function() search_type = 'site' search_item = GetSearchItem() if search_item == '' then return nil end -- get the default engine for site based searching for _, url in engineFallback:gmatch('([^,]+),(.+)') do engine_url = url end -- if is set, use search engine from properties local sEngine = props['Inet.Search.SearchOnSite.Engine'] if sEngine ~= '' then local tEngines = GetEngines() for i = 1, #tEngines do if tEngines[i][1] == sEngine then engine_url = tEngines[i][2] break end end end tableSelection = GetSearchSites() -- if none entries for search sites, use simple search if tableSelection == nil then RunSearch(search_item, engine_url, nil) else -- only one entry: selection box will not shown if #tableSelection == 1 then RunSearch(search_item, engine_url, tableSelection[1][2]) else ShowSelectionList() end end end --> SearchSiteBased ------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------- Publicate functions InetSearch.Engine = SearchEngineBased InetSearch.Site = SearchSiteBased ------------------------------------------------------------------------------------------------ end ----------------------------------------------------------------------------------------------------  
      InetSearch.lua
    • Jos
      By Jos
      7/8/2018: Uploaded a new SciTe4AutoIt3.exe v18.708.1148.0 installer.
      It has been over a year since the last update of the full SciTE4AutoIt3 installer whch mainly had to do with the fact that Neil was moving toward v4 of SciTE and I wanted to wait for a stable version.
      Any help with testing this version before general release is appreciated.
      Also any feedback is welcome in caseI missed something or suggestions for improvement before releasing.
      ==> SciTE4AutoIt3 v18.708.1148.0
      Enjoy,
      Jos

      Addition/Changes/Fixes in the current installer:
      -------------------------------------------------------------------------------------------------- 8-7-2018 *** Merged the SciTE v 4.1.0 by Neil Hodgson with our own version of SciTE. (Jos)     This is a major change from the previous version so ensure you update all files including LUA or else you will get errors!     - SciLexer au3: Fixed issues with nested CommentBlocks not always showing the correct color.     - SciLexer au3: Change any line starting with # and no recognised keyword to be shown with the Pre-Processor in stead of default.     - Changed Shortcut for AU3INFO to Ctrl+Shift+F6.     - Moved the session restore logic for (save.session.advanced=1)into SciTE in stead of LoadSession.lua as that was clearing the recent files list of the last session       when opening a file by double cliking it. This is fixed with this change.       Default remains 0 so when a file is double clicked the last session isn't restored unless you add this to SciTEuser.properties:       "save.session.advanced=1"     - updated Tools.lua replacing [s%] with [ /t] to avoid empty lines being stripped by those functions. (Thanks Enyby) *** Updated AutoIt3Wrapper v18.708.1148.0 (Jos)     - 17.224.935.1 Added /autoit3dir to au3stripper commandline, when provided to AutoIt3Wrapper., to ensure the included files are for the correct AutoIt3 directory     - 17.224.935.2 Added directives:          #AutoIt3Wrapper_Res_CompanyName=          ;Company field          #AutoIt3Wrapper_Res_LegalTrademarks=      ;Trademark field     - 17.224.935.5 Fixed Versioning when files contain backets ->  ()     - 17.224.935.6 Added support for :          #AutoIt3Wrapper_Au3stripper_Stop_OnError=        ;(Y/N) Continue/Stop on Warnings.(Default=N)     - 17.224.935.7 added INI support for:           [Other]            Au3Stripper_Stop_OnError=n     - 17.224.935.10 Minor changes in console messages     - 17.224.935.11 Modifications from JPM:         - add #AutpIt3Wrapper_Res_Cursor_Add         - "clean" a little bit AutoIt3Wrapper.au3 *** Updated Au3Stripper v18.708.1148.0 (Jos)     - 17.224.935.1 Fixed crash when an include file contains longer record than 4096 characters.     - 17.224.935.2 Changed /rsln to replace @ScriptLineNumber in the Master script with "XXX/YYY". XXX is the master script linenumber, YYY is the Merged script linenumber.     - 17.224.935.3 Fixed issue detecting #cs #ce when a space was missing after the directive.     - 17.224.935.4 Changed Close/Open logic for Tracelog to (hopefully) avoid the hardcrash.     - 17.224.935.5 improved speed avoiding rereading include files to determine the max rec len.     - 17.224.935.6 improved speed by re-coding the check for long records.     - 17.224.935.7 Made sure the returncode is the highest from all iterations in stead of the last iteration.     - 17.224.935.8 fix for reported bug: https://www.autoitscript.com/trac/autoit/ticket/3623#comment:4     - 17.224.935.9 added support for #autoit3wrapper_autoit3dir     - 17.224.935.10 Fixed support for #autoit3wrapper_autoit3dir when followed by linecomment                     Stop processing when include file isn't found.     - 18.624.1847.1 strip the leading and trailing double quotes from the autoit3dir directive to avoid an error when they are specified.     - 18.624.1847.2 Fixed Hardcrash in the Include logic     - 18.624.1847.3 Fixed Hardcrash in Func stripping logic by enlarging the base table size     - 18.702.1556.1 Fixed regression bug with the Translate option.     - 18.703.1808.2 Fixed regression bug with the Stripping FUNC logic for the first found FUNC. *** Updated SciTEConfig v18.708.1148.0 (Jos)     - 17.224.935.1 No updates *** Updated Tidy v18.708.1148.0 (Jos)     - 17.224.935.1 Added option  to copy comments from #CS to #CE. Default is to copy the comments.                    Added Tidy Parameters:  /Skip_CE_Comment or /scec will skip this copy action                    Added INI option:                      * * *  Add comment to #CE/#CommentEnd and make it the same as the #CS/CommentStart Comments.                      ce_comment=1     - 17.224.935.2 Fix issue with Copy comments on comment start - end     - 17.224.935.4 Fix another issue with Copy comments on comment start - end -------------------------------------------------------------------------------------------------- ==> ScitillaHistory page containing all SciTE-Scintilla updates.
      ==> Visit the SciTE4AutoIt3 Download page for the latest versions
      ==> Check the online documentation for an overview of all extra's you get with this installer.
    • sumanth1980
      By sumanth1980
      Here i am wrote a simple lines to install basic applications but when i clicked on one application/program to install it was working fine but when i cancel the program in the middle to install another program it was not working. I am not an expert in this but i want a solution for this ... Can any one help me on this....
      ORG-1.au3
×