Jump to content

Using '_Singleton' function in compiled script


Go to solution Solved by water,

Recommended Posts

I'm wondering two things about _Singleton and the way it works in a compiled script.

#include <Misc.au3>
If _Singleton("test", 1) = 0 Then ;If test is compiled do I have to write _Singleton("test.exe", 1) instead?
    MsgBox(0, "Warning", "An occurence of test is already running")
    Exit
EndIf
MsgBox(0, "OK", "the first occurence of test is running")

At first in the above example I'ld like to know how to name my 'test' script when it will be compiled. Do I have to add the EXE file extension at the end of the script name ? It seems to be not clearly explained in the help file, or at least I didn't find the info.

Then I'ld like to know what's the first line action in a compiled script. Does the #include function add the whole code lines from the included AU3 script to the current script before compiling? This is how I understand it but I'm maybe wrong so I'ld like to confirm it from experienced peoples.

At last, could you please tell me if there's a place in the AutoIt community websites where I could post my entire script to share the ideas in it and to also allow other AutoIt coders to review the script? It's my first AutoIt complicate script (at least from a newbie point-of-view) and I'm near sure that some things I've made complicate could be done a more simple way. That's why I surely need some advices to progress in my AutoIt skills learning.

Link to comment
Share on other sites

  • Solution

The first parameter for _Singleton is just a string. No need to rename it when the script is compiled. _Singleton works the same way if you run the script from SciTE or a compiled exe.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

At last, could you please tell me if there's a place in the AutoIt community websites where I could post my entire script to share the ideas in it and to also allow other AutoIt coders to review the script? It's my first AutoIt complicate script (at least from a newbie point-of-view) and I'm near sure that some things I've made complicate could be done a more simple way. That's why I surely need some advices to progress in my AutoIt skills learning.

 

You can post in this section and ask for review in the title ( like Please review - "My Script goal" ), and when is finished/working maybe in the Example's section if you think your script is a "cool script"

Edited by Terenz

Nothing is so strong as gentleness. Nothing is so gentle as real strength

 

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