legend

Detect if script is being compiled right clicking or via SciTe

5 posts in this topic

#1 ·  Posted

Hello,

is there any way to detect if a script is being compiled by right clicking on it, and compile, or compiling with SciTE?

The reason I ask is because i'm using some autoit wrappers that only will be added if you compile with SciTE.

So I want the script to warn me with a msgbox if it's being compiled by rightclicking and compile.

Share this post


Link to post
Share on other sites



#3 ·  Posted

legend,

While I entirely agree with JohnOne's suggestion above, you might also consider creating a small executable to show a MsgBox and then use a #AutoIt3Wrapper_Run_Before= directive to announce that the script is being compiled from within SciTE. I realise that is the reverse of what you required, but if you really need to distinguish between the 2 cases, this would seem to be the only way.

M23


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

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

18 minutes ago, Melba23 said:

legend,

While I entirely agree with JohnOne's suggestion above, you might also consider creating a small executable to show a MsgBox and then use a #AutoIt3Wrapper_Run_Before= directive to announce that the script is being compiled from within SciTE. I realise that is the reverse of what you required, but if you really need to distinguish between the 2 cases, this would seem to be the only way.

M23

Hi Melba, Thank's, but that won't work, the thing is I just wanted to warn myself In case I forgot to compile with SciTe,

but just right clicked the au3 script and clicked compile, but I can't use a wrapper to detect it, since compiling it without

SciTe ignores autoit wrappers.

 

I think i'm out of luck, no code can detect it because no script if running when compiling it, can only be done with wrappers, witch isn't a option here. I just make a comment in the top of my script that says: remember to compile with SCiTe :)

Edited by legend

Share this post


Link to post
Share on other sites

#5 ·  Posted

If you really want something like this you could create and compile the following script for example C:\Scripts\CompileScript.exe:

#NoTrayIcon
If $CMDLINE[0] = 0 Then Exit

Global $iCOMPILE = MsgBox(36, 'Compile AU3 Script', 'Do you want to complie "' & $CMDLINE[1] & '"?')
If $iCOMPILE = 6 Then
    RunWait('"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "' & $CMDLINE[1] & '"')
Else
    Exit
EndIf

Replace HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Compile\Command (default) with:

C:\Scripts\CompileScript.exe "%1"

Now if you right click and compile you can choose whether you want to compile or not.

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