legend Posted January 4, 2017 Share Posted January 4, 2017 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. Link to comment Share on other sites More sharing options...
JohnOne Posted January 4, 2017 Share Posted January 4, 2017 Look at your hands and the screen, if your finger clicks on the icon and selects compile from the context menu, it's unlikely being compiled with scite. mLipok 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 4, 2017 Moderators Share Posted January 4, 2017 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
legend Posted January 4, 2017 Author Share Posted January 4, 2017 (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 January 4, 2017 by legend Link to comment Share on other sites More sharing options...
Subz Posted January 4, 2017 Share Posted January 4, 2017 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now