Jump to content
Sign in to follow this  
CyberSlug

*autosense*

Recommended Posts

Edited note: the following information was being composed while the previous replies were being added. I did not see them before I did this. I will check them out. I will also be more correct in my "stopped" terminoligy. Thanks

===============================================

Re AutoComplete in TextPad:

I tried to figure this out myself before anyone could reply:

I added a tool for the Program FullPath\AU3GUI.exe

For the Parameter I changed from $File to $SelWord

Left Initial Folder as $FileDir

Made a hot key = CTL-, (comma) because CTL-J is already assigned.

Started typing function name, pressed CTL-, and some type of window object is popping up. Entire new window is filled in with default system colors, can see nothing to choose from. I can resize, and move, but cannot do anything with it. Closes normally so I can continue.

Tried using $SelLine vs. $SelWord with same results. I think I am close, but need some help here.

Also suggest adding the final definitions to the installation documentation in a section for TextPad.

Thanks for listening.

Edited by BobHansen

Hope this was helpful.............good luck, Bob

Share this post


Link to post
Share on other sites

I added a tool for the Program FullPath\AU3GUI.exe

For the Parameter I changed from $File to $SelWord

Left Initial Folder as $FileDir

Nooooooooo.

Don't mess with any TextPad hotkey settings B) AutoSense is designed to be compatible with nearly any text editor--even Notepad (despite what Larry says :whistle:)

I do, however, have a toolbar button defined in TextPad that runs "C:\Program Files\AutoIt3\AutoIt3.exe" D:\MyScripts\AutoSense.au3 I click the button to enable AutoSense; I click it again to disable. If you use the JdeB's 0.2.2 mod, then I think AutoSense starts automaticlally when you open an au3 file.

Okay, I'm calling it it night. Good luck!


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

JdeB sent me a modification that makes AutoSense installation automatic. 

CS,

made the modifications for your Autosense ver 1.0 and made it available here: http://www.hiddensoft.com/fileman/users/jd...stal_asedit.zip

this is the include text:

Files:

AUEdit.au3  - is CyberSlugs Autosense.au3 program with modifications

Instal_ASEdit.au3 - Install program for AUEdit.au3

Description:

This is an install program that installs the AUEdit (AutoSense) program as the program to start for " Right mouse click" -> Edit Script option ... (changing Jon's Notepad setting)

This is what is does:

; This script assumes that the AutoSence program is called ASEdit

; It will prompt to select an editor program.

; Then start this program and asks to press PAUSE (this to capture the Title

; Stores this info into  AutoSense.ini which can be use by ASEdit.exe

; Then modifies the "Edit Script" setting to ASEdit.Exe

The included ASEdit.au3 is based on CyberSlug's AutoSence.AU3 and all modified code is list by ";####"

I only made changes to have it start your editor.

Edited by JdeB

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

Share this post


Link to post
Share on other sites

Thanks, JdeB :whistle:

If anyone has problems with my less-than-wonderful documentation/setup, use JdeB's version 'cause I'm going to sleep.

Edit: JdeB's link from the preceding post is http://www.hiddensoft.com/fileman/users/jd...stal_asedit.zip

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

I took a look at how you wrote it, CyberSlug, and to be honest, I'm scared to touch it to try to enscapulate it in that framework :whistle: . Sure, its not as modular, but can it really afford the overhead of all the extra function calls? Normally I prefer a C++ (or object-oriented) approach to things, but this is one time I must concede that the C (or procedural) method is going to be the better choice. Its also difficult for me to test because I have a very fast processor, so what works for me may not work on slower machines.

Share this post


Link to post
Share on other sites

Revisiting an idea I had earlier, I think I've just come up with a way that might make it possible to allow user functions to appear in the autocomplete listbox. Instead of attempting to read the current file or current #include's or whatever, a better solution may be to allow the user to specify (For now, hopefully at some point in the future, when/if the C-like #include stuff I wrote gets added, read from the registry) the paths to libraries. The script could then use FileFindFirst/Next logic to iterate through all the files and build a list of functions.

I think this would be very helpful. I know that I have learned about lots of Windows API functions (And C\C++ standard functions, too) by simply typing :: in VS and browsing through the functions in the global namespace. It might be useful for making some of us more familiar with what the standard library holds and also to use our own libraries better. I'm about 80% finished with an exhaustive AU3GUIXP API that has over 40 functions. There's no way in hell I'll remember most of the seldom used stuff and probably won't remember most of the functions in about 2 days, anyway. I also have several other much (much, much, much) smaller libraries that I can't remember functions from.

I don't think its such an issue for getting functions from the current script or project. Usually you have those files open anyway, so its not much effort to look. But it gets to be more of a pain to have to navigate directory structures to find a file, then open it and lookup a function in that file because you documented it poorly :whistle: .

I haven't given the coding for this much actual thought. It just came to me a little bit ago. I don't think it will be too hard, however. Since all functions are preceeded by Func, it should be fairly easy to write a parser to find that keyword and then break it into useful parts (I guess that would be a lexer, now, wouldn't it?).

Edited by Valik

Share this post


Link to post
Share on other sites

CS, there's some sort of issue when the script runs for a long period of time. I'm not sure what it is, but as just a thought, it might be that the hotkeys are becoming unregistered. I've had it happen several times to me today and I don't know why it happens or what causes it.

Edit: By issue, I mean the tooltip doesn't display when it should. It may not be the hotkey on second thought (I just remembered that the hotkey for the auto-complete box works)

Edited by Valik

Share this post


Link to post
Share on other sites

CS, there's some sort of issue when the script runs for a long period of time.

Hence the easy way to start and restart :whistle:

I'll look into the problem. (In fact, I printed out the code earlier today and skimmed through it.) I haven't run AutoSense for long periods since most of my recent scripting has been coding the AutoSense script itself--which requires resets/restarts.

EDIT: Also keep in mind that, by default, Esc clears the "tooltip stack." You can add something like TrayTip("Stack Debug", $STACK, 30) inside the main loop body to help trace stuff.

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

I'm afraid I haven't solved the problems Larry and Valik have encountered.

However, I'm developing a branch of AutoSense that should work better with text editors which are compatible with AutoIt's ControlGetText--editors such as Notepad and metapad.

Here's a draft which should display a helpful tooltip when you move your cursor within the parameter list of a function.

Let me know what you think so far :whistle: I wish this would work with TextPad; I want syntax coloring!


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Sadly, TextPad doesn't like anything we can send it. I don't think there's a single control in the damned thing that will accept a message from AutoIt (Except for ControlSend...)

Share this post


Link to post
Share on other sites

I don't think there's a single control in the damned thing that will accept a message from AutoIt (Except for ControlSend...)

WinMenuSelectItem works :whistle:

Crimson, UltraEdit, etc don't like the ControlCommand's either. I'm guessting the syntax coloring (richtext) implementation is what causes problems....

It could be worse, though: EditPad and AnyEdit don't even like WinGetCaretPos()


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

WinMenuSelectItem works  :whistle:

Crimson, UltraEdit, etc don't like the ControlCommand's either.  I'm guessting the syntax coloring (richtext) implementation is what causes problems....

It could be worse, though:  EditPad and AnyEdit don't even like WinGetCaretPos()

I thought WinMenuSelect would probably work after I posted. Right after posting, I opened a menu for something and noticed my transparency program made the menu transparent, which meant it was probably class #32768 (The control WinMenuSelect likes, for those not familiar...).

CS, if you want to implement some sort of tracing in AutoSense for debugging, here's is a function that might be useful:

Func Trace($szMsg)
    If @Compiled Then Return; Don't trace if we're compiled
    TrayTip("Trace", $szMsg, 10, 16); Cause I hate the sound...
EndFunc

It obviously will only display when running non-compiled since its rare to compile a script just to debug it.

I encountered another bug, but I don't know why it happened. It suddenly started replacing my function with just the first letter of it. It had been working fine before, so I don't know what prompted this behavior. I coerced it into stopping this for a moment, but it wouldn't display tooltips, then it went right back into being mean and erasing my word again. I eventually gave up and restarted it.

Share this post


Link to post
Share on other sites

I think I need to sit down and look at the AutoSense framework, and maybe rework some things.

By the way, there are some bugs in the draft for notepad/metapad ...

EDIT: Uploaded new version that should work well with metapad! However, it doesn't work quite right with notepad.

Edit: A metapad-only version that seems flawless

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Found another small bug. One time earlier I had it paste the contents of my clipboard to my editor (I assume the case fix thing did it, but I don't really know, haven't looked at the code to see where any paste actions are occuring).

Share this post


Link to post
Share on other sites

I've also experienced the clibpard-content-pasting bug.....

However, it only occured for the very first text I typed after launching AutoSense.

:Grr: on bugs, but thanks for the feedback!

P.S. I have a new framework for metapad (see above post). I should have a metapad-version of AutoSense available soon!

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Very neat CS. While you are at it you might want to try playing with Scintilla and SciTE

http://www.scintilla.org/


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!"

Share this post


Link to post
Share on other sites

SciTE might make AutoSense obsolete!

I just wish I had remembered before you went to all the trouble :whistle:

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!"

Share this post


Link to post
Share on other sites

From what I've seen of SciTE so far, I probably won't use another editor for awhile if I can figure out how to get everything work right in it. Although I think AutoSense is very nice for any other editor. Still, you usually can't be the functionality when its built-in. And, collapseable code blocks... something that couldn't be implemented in a script.

Edited by Valik

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...