Jump to content

SciTE Compile - fill in Description etc. fields from variables in script?


Go to solution Solved by emendelson,

Recommended Posts

I use two copies of the same script to compile the script under two different names. The scripts perform different actions depending on the filename of the script, and so it's easy for me to compile one copy of the script and then make a copy of the compiled exe under another name.

However, if I do this, both copies of the exe have the same text in the Description and Comment fields. Is it possible to change the contents of the Description and Comment fields according to a variable in the script that gets set differently depending on @Scriptname? That way, I could simply make a copy of the script under a different name and compile both scripts, and the compiled exes would have different Description and Comment fields.

This probably isn't possible, but if it is possible, I'll be grateful to learn how.

Link to comment
Share on other sites

take a idea

.. or that is enough?  :)

Switch @scriptName
    Case "scriptName1.au3" ; .exe if compiled
        GUICtrlSetData ( $Description, "Description1" )
        GUICtrlSetData ( $Comment, "Comment1" )
        actions1()

    Case "scriptName2.au3" ; .exe if compiled
        GUICtrlSetData ( $Description, "Description2" )
        GUICtrlSetData ( $Comment, "Comment2" )
        actions2()
        
EndSwitch

 

Edited by ioa747

I know that I know nothing

Link to comment
Share on other sites

Thank you for these suggestions! Unfortunately, I can't make them work in the header part of the file that looks like this. You'll see that I tried the commented lines, but they didn't have any effect. Probably I'm missing something obvious - a command to run before compiling -  or this simply isn't possible:

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=PrintFilePrinter.ico
; If @ScriptName = "PrintFilePrinter.au3" Then
#AutoIt3Wrapper_Res_Comment=PrintFilePrinter
#AutoIt3Wrapper_Res_Description=PrintFilePrinter
; Else
;   #AutoIt3Wrapper_Res_Comment=PDFWatchPrint
;   #AutoIt3Wrapper_Res_Description=PDFWatchPrint
; EndIf
#AutoIt3Wrapper_Res_Fileversion=1.0.0.98
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Run_After=d:\dropbox\signfilesem.exe "%out%"
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

 

Link to comment
Share on other sites

  • Developers

The description is stored in the PE header of the program, so it can't be dynamically updated at script runtime, when that is what you want.

Making a copy and then updating the PE header of the copy is always possible, since that is basically what AutoIt3Wrapper does. :) 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

8 minutes ago, emendelson said:

Thank you for these suggestions! Unfortunately, I can't make them work in the header part of the file that looks like this. You'll see that I tried the commented lines, but they didn't have any effect. Probably I'm missing something obvious - a command to run before compiling -  or this simply isn't possible:

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=PrintFilePrinter.ico
; If @ScriptName = "PrintFilePrinter.au3" Then
#AutoIt3Wrapper_Res_Comment=PrintFilePrinter
#AutoIt3Wrapper_Res_Description=PrintFilePrinter
; Else
;   #AutoIt3Wrapper_Res_Comment=PDFWatchPrint
;   #AutoIt3Wrapper_Res_Description=PDFWatchPrint
; EndIf
#AutoIt3Wrapper_Res_Fileversion=1.0.0.98
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#AutoIt3Wrapper_Run_After=d:\dropbox\signfilesem.exe "%out%"
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

 

Oh, so that Description & Comment, you mean

Why do you mix AutoIt3Wrapper directives section with your script?

take a look to https://www.autoitscript.com/wiki/SciTE4AutoIt3#AutoIt3Wrapper

The description is static so that how your program knows which file you will run?

I thought you have a textbox with the Description & Comment in your program  :)

 

 

I know that I know nothing

Link to comment
Share on other sites

  • Solution

Thank you! Understood. I should have been more clear about what I was asking about. I already have the equivalent of a Switch command in my script to change MsgBox titles, etc. - I was only hoping for something that's obviously impossible: changing the AutoIt3Wrapper directives dynamically. Thank you again, and apologies for time-wasting.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...