Jump to content

How to add a UDF to Auto It?


 Share

Recommended Posts

There was no reason for threatening to ban me from the forum; I wasn't abusive as you were.

Mike

The word "ban" is nowhere but in this post, so I guess that means you must have threatened yourself. You're a weird guy.

(signatures doesn't count, annoying guy is just annoying)

Link to comment
Share on other sites

Because of the way my system is set up as multi-boot and because W7 doesn't respect drive letters already assigned I wrote this to save me having to open the registry each time I need to update.

Just put a copy of this script in whatever folder you are keeping your non-standard UDFs in and run it; end of problem

$s_Val = "Include"
$s_RegKey = "HKCU\Software\AutoIt v3\AutoIt"
$s_CurrentVal = RegRead($s_RegKey, $s_Val)
If $s_CurrentVal = "" Then
    RegWrite($s_RegKey, $s_Val, "REG_SZ", @ScriptDir)
Else
    If NOT StringInStr($s_CurrentVal, @ScriptDir) Then
        RegWrite($s_RegKey, $s_Val, "REG_SZ", $s_CurrentVal & ";" & @ScriptDir)
    EndIf
EndIf
MsgBox(0, "Finished", "The folder path has been added to the registry." & @CRLF & $s_RegKey & "\" & $s_Val & " = " & RegRead($s_RegKey, $s_Val))

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • 8 years later...
  • 2 years later...
On 10/23/2011 at 5:54 PM, Melba23 said:

mikejp56,

 

The Adding UDFs to AutoIt and SciTE tutorial in the Wiki tells you how best to store and use downloaded UDFs. :graduated:

 

M23

This tutorial doesn't actually tell you where to put the UDF. It teaches you how to let Scite/AutoIt know where you have created the folder but it doesn't appear to make a suggestion as to where that folder should be. It does tell you where not to put it. Am I missing something?

I conclude that it should be something like C:\Users\%USERNAME%\Documents\AutoIt\UserInclude

Phil Seakins

Link to comment
Share on other sites

  • 10 months later...
On 10/23/2011 at 5:54 PM, Melba23 said:

The Adding UDFs to AutoIt and SciTE tutorial in the Wiki tells you how best to store and use downloaded UDFs.

The question on my mind when I came to this thread was not just "how to add a udf" but also "where to place the udf".

The wiki tells you how but doesn't seem to make any suggestions as to where, leaving you to create your own folder. So the question goes unanswered.

Long ago I decided to place my scripts in a folder named "AutoIt" under my "My Documents" folder.
Microsoft fiddled around with the location of "My Documents" with each new version and on the last iteration I settled on "C:\Users\username\Documents\".
I placed most AutoIt scripts under "C:\Users\username\Documents\AutoIt" and the first time I needed a UDF it went in a "UserInclude" folder under that.

So my UDFs go under "C:\Users\username\Documents\AutoIt\UserInclude". As good a place as any.

Of course, once you have it set up you can find out where it is by typing "CTRL-1" in Scite. But one doesn't always remember that after a year or two, especially if you are old and grumpy like me.

This post might help someone.

Phil Seakins

Link to comment
Share on other sites

On 8/14/2023 at 11:26 AM, pseakins said:

This post might help someone.

OMG. This is hilarious. Or is it sad? I didn't even read my own post from 10 months ago. I went through the same struggle as I did last year, came to the same conclusion and decided to report it here - again.

Phil Seakins

Link to comment
Share on other sites

On 8/13/2023 at 9:26 PM, pseakins said:

But one doesn't always remember that after a year or two, especially if you are old and grumpy like me.

..therefore I, put'em in the same includes folder. That way I don't have to remember a thing. :D 
(anyone here plz don't follow my doing, I know that I'm disorganized)

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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