Jump to content

Recommended Posts

Posted (edited)

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:

  Reveal hidden contents

 


 
Installation:
 

  Reveal hidden contents

[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.)

[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:
 

  Reveal hidden contents

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:
 

  Reveal hidden contents

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:
 

  Reveal hidden contents

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

Update: ResourceManager_v2 (a seperate version, see below)
 

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

  Reveal hidden contents


 
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

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...

Posted

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

FileGetSize
FileGetTime
FileGetVersion

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
  On 8/9/2013 at 5:50 AM, mlipok said:

 

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...

Posted

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...

Posted

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:

  Reveal hidden contents

Updated: 22/04/2018

Posted

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:

  Reveal hidden contents

Updated: 22/04/2018

Posted
  On 8/9/2013 at 7:14 AM, guinness said:

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...

Posted (edited)
  On 8/9/2013 at 7:13 AM, guinness said:

 

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...

Posted

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:

  Reveal hidden contents

Updated: 22/04/2018

Posted

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]

Posted
  On 8/9/2013 at 11:02 AM, Edano said:

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...

  • 3 weeks later...
Posted

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

  Reveal hidden contents


 
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...

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
×
×
  • Create New...