Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

Post your working scripts, libraries and tools for AHK v1.1 and older
Guest

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

17 Jun 2017, 02:48

Would it be hard to implement this "always open" feature by switching to the previous window with ALT-TAB or something like this -

https://autohotkey.com/board/topic/5403 ... -is-wrong/

When I select Copy Snippet the editor window opens. I thought that would copy the snippet to the clipboard?

Would it be hard to add an option to have the double-click perform a copy instead of a paste? Is it easy to add a button on each line that does a copy?
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

17 Jun 2017, 04:03

To copy a snippet only upon double click and not paste it use the setting PasteMethod = 2. (Some plugins may not work properly so YMMV.)

Copy a snippet means you create a new snippet based on the one you selected, that way you can create a similar snippet without the need to retype everything again, just like copying a file for example.

Like I said it is not as easy as it sounds. You would indeed have to ensure the program you came from (currently active) has focus again before something is pasted, sending !{esc} might work but probably not always reliably.

Therefore it might actually be easier (relatively speaking) to not make the Lintalist window active when you open and click on it (if you want to use the mouse).
You can do that with something like "+AlwaysOnTop +E0x08000000 ; +E0x08000000 = WS_EX_NOACTIVATE" (same line as "Gui, 1:+Border...") and adding "NA" to Gui Show.
Drawback of that is the menu and search feature no longer work as you can't make the Lintalist window take focus very easily and not having search kind of defeats the purpose.
Not sure how to tackle it in the most reliable way at the moment. :think:
mrmed
Posts: 3
Joined: 15 Jun 2017, 02:53

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

06 Jul 2017, 00:14

Thanks! The window stays open and double-clicking usually pastes into the correct window, but sometimes it pastes into the window that was edited 2 selections ago.
Can I make additional feature requests?

1) Copy on click. There is already an icon to the left of the text. Clicking it could copy the text to the clipboard.
2) Minimizable window.

Thanks very much for being so open to feedback!
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

06 Jul 2017, 10:12

This may (or may not) work slightly better https://github.com/lintalist/lintalist/ ... -309209435

1) like I said you can already do a copy to clipboard upon a DoubleClick: Configuration, set PasteMethod = 2. Ensure that DoubeClickSends = 1 - you can combine that with a setting SingleClickSends.

2) You can simply close it by pressing the X (top right) or activate Search (press hotkey) and press Esc to close it. Pressing the Search hotkey again will bring it back to front/open the Gui in the Not Active mode.

This is probably about as far as the default Gui can go. Otherwise making a second Gui with fewer features (no menu, no button bar, no search) combined with "not context sensitive" (simply loading all bundles) is probably "easier" so it can bypass certain sections of the main script and thus avoid any errors in the flow / processing of snippets.

Edit: re 2 - you can try to remove "+Toolwindow" from the Gui line - if you do that there will be a minimize button on the Window Title bar.
Edit2: July 14th - added info about SingleClickSends ;)
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

06 Nov 2017, 15:38

Lintalist v1.9.3 - https://github.com/lintalist/lintalist/ ... tag/v1.9.3
  • Improved: TriggerKeys now accept more keys such as ½ or + (+ character, not shift) for example
  • Improved: Now there is also a 32x32 size icon button bar accommodating high(er) DPI settings (see BigIcons in settings)
  • New: added TryClipboard() to see if clipboard is inaccessible, if so "catch" error and do nothing
  • New: Make it possible to include contents of Snippet (part 1 and 2) in script code incl. caret position per snippet (see "Script" in Documentation)
  • Change: Similar to modal windows for Local variable etc, Snippet editor now modal - see also v1.8
  • Fix: Adding support for UTF-8 characters in Local variabe & Counter Editors ht @exetico
  • Fix: ReadIni() now writes in UTF-16 to store settings correctly
  • Fix: Closing using X in title bar didn't store Window position for users with Center=2 and now save it to settings.ini as well
  • Fix: Closing and Starting Lintalist in Narrow view mode no longer causes error in GUI with empty 'barx' variable
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

08 Nov 2017, 14:38

Below is my first plugin for Lintalist.

It produces an Ordinal Indicator for a number. That is the "st nd rd th" that goes after a number in English.

[[OrdinalIndicator=3]] will produce "rd"
[[OrdinalIndicator=3|]] will produce "3rd"

Code: Select all

/* 
Plugin        : OrdinalIndicator
Purpose     : Insert ordinal indicator for number (st nd rd th)
Version      : 1.0
Author       : FanaticGuru
*/

GetSnippetOrdinalIndicator:
Loop 
	{
		If (InStr(Clip, "[[OrdinalIndicator=") = 0) or (A_Index > 100)
			Break
		If InStr(PluginOptions,"|")	; Insert after number if option otherwise replace number
			PluginSnippetVariable := StrSplit(PluginOptions,"|").1 OrdinalIndicator(StrSplit(PluginOptions,"|").1)
		else
			PluginSnippetVariable := OrdinalIndicator(PluginOptions)
		StringReplace, clip, clip, %PluginText%, %PluginSnippetVariable%, All
		PluginSnippetVariable:=""
		PluginOptions:=""
		PluginText:=""
		ProcessTextString:=""
	} 
Return

OrdinalIndicator(n)
{
	return Mod(n+9,10)>=3||Mod(n+89,100)<3?"th":Mod(n,10)=1?"st":Mod(n,10)=2?"nd":"rd"
}
This was mainly done to learn about how to make Lintalist plugins.

I really like Lintalist. It is one of the scripts I always have running. But I was not too crazy about the plugin system. It took me longer than it seems like it should have for me to read and understand how to create my first plugin.

It would seem so much easier and intuitive if plugins were just "functions". As opposed to the current system of gosubs with global variables that creates an overhead that you have to understand of how input and output works with the gosubs. Functions inherently already have an understood system of input through parameters and output through return.

[[OrdinalIndicator(1234)]] would seem so much easier to understand in the Lintalist markup, in the creation of the plugin, and even in the source coding of Lintalist. Just put a bunch of custom functions in a folder and those functions then become useable in the Lintalist markup.

It would be great if I could just copy a dozen functions that I already have for things like putting commas in numbers, formatting money, padding strings, various string manipulations, etc. (basically standard function from my AHK library) into a folder with no modification and then have them available to use in Lintalist.

Maybe a dual system where <<OrdinalIndicator(1234)>> indicates a custom function and not a plugin.

There might be other problems with this approach that I have not thought about and it would be a major modification at this point. Just my feedback. The most important feedback being that I really do like Linalist.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

09 Nov 2017, 17:10

FanaticGuru wrote:Below is my first plugin for Lintalist. It produces an Ordinal Indicator for a number.
Yay - first third party plugin :-)
Would be useful for others as well I think, would you mind if I included in a future version?
FanaticGuru wrote:This was mainly done to learn about how to make Lintalist plugins. ... It took me longer than it seems like it should have for me to read and understand how to create my first plugin.
Just curious: did you see the readme-howto.txt and template.plugin files / documentation?
FanaticGuru wrote:.. I could just copy a dozen functions ... into a folder with no modification and then have them available to use.
There is certainly room for improvement - large part of the code is spaghetti code (long story, but I thought it "best" to go with labels and the =option|option vs ("option","option","option")).

I've thought about adding some form of plugin management:
  • either by having a GUI which looks at files in a folder and presents a listview with checkboxes allowing you to select which ones you'd like to add and/or remove.
  • Or just entirely dynamic: either based on user input ("update plugins") or always at start up (lintalist.ahk would just become a launcher for a new "main script")
This would create the #include and menus at each start up - something like the plugins framework from majkinetor.
The reason for #includi-ng everything is otherwise it won't find the functions (labels) - because they are being called as "%PluginName%" and that won't work with a "\lib\" folder so some form or pre-processing is required for it to work "automatically".

It doesn't matter that much if I call IsLabel or IsFunc so as such it wouldn't be too much work to also allow functions. I think.
FanaticGuru wrote:... I really do like Linalist.
:-)

All suggestions remain welcome - for example if you have any thoughts on modifying the Choice plugin - let me know https://github.com/lintalist/lintalist/issues/53
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

13 Nov 2017, 21:18

list wrote:
FanaticGuru wrote:Below is my first plugin for Lintalist. It produces an Ordinal Indicator for a number.
Yay - first third party plugin :-)
Would be useful for others as well I think, would you mind if I included in a future version?
You are more than welcome to use any of my code anyway that you want.
list wrote:Just curious: did you see the readme-howto.txt and template.plugin files / documentation?
I did but it just was not very intuitive and took me a bit to puzzle out what you were explaining.

Maybe a super simple plugin called "Example" would help like:

Code: Select all

/* 
Plugin        : Example
Purpose     : Add two options separated by | together
Version      : 1.0
Author       : You
*/

GetSnippetExample:	;	GetSnippet is Standard followed by {Plugin File Name}
Loop 	; Standard Loop for All Plugins
	{
		If (InStr(Clip, "[[Example=") = 0) or (A_Index > 100)		; Standard  Break condition for All Plugins, replace "Example" with {Plugin File Name}
			Break
		X := StrSplit(PluginOptions,"|").1 + StrSplit(PluginOptions,"|").2	; Access options divided by | to add two options together
		StringReplace, clip, clip, %PluginText%, %X%, All	; Insert User Defined Variable into Lintalist Clip in place of Plugin Markup
		X:=""	; Clear User Defined Variable
		PluginOptions:=""	; Clear Standard Plugin Variable
		PluginText:=""	; Clear Standard Plugin Variable
		ProcessTextString:=""	; Clear Standard Plugin Variable
	} 
Return
I did not actually test this and you could refine the comments or plugin but something like this would have made it very clear to me very quickly. I think one problem I had was that I did not quickly realize what was Standard Global stuff and what was stuff I could change whether it be structural stuff in the plugin or variable names.
list wrote:It doesn't matter that much if I call IsLabel or IsFunc so as such it wouldn't be too much work to also allow functions. I think.
An ability to do functions would be nice. You can still use #include to get them in your script. I think that is fine.

How to designate them in the markup is a design choice. Could be something different than [[ ]] like << >> or could be a character within the standard syntax like [[*SomeFunction()]] with * being whatever character seems like a good flag for a function. Could also just autodetect if there are () and no = sign.

The source code would need to handle the inserting whatever the function returned into the PluginText.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

14 Nov 2017, 12:28

I'll play around with functions and post an update here. Thanks for the clarification / example.

Edit: outline https://github.com/lintalist/lintalist/issues/86
Last edited by list on 15 Nov 2017, 12:44, edited 1 time in total.
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

15 Nov 2017, 12:21

What if I added support for (some of) AutoHotkey's built-in variables, so you could just write A_MyDocuments anywhere in your snippet (or plugin) and it would be translated to the correct value.
User avatar
FanaticGuru
Posts: 1906
Joined: 30 Sep 2013, 22:25

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

15 Nov 2017, 14:23

list wrote:What if I added support for (some of) AutoHotkey's built-in variables, so you could just write A_MyDocuments anywhere in your snippet (or plugin) and it would be translated to the correct value.
The paths could be useful. Maybe the time ones although you already have the DateTime=.

If it is just the path ones if might be better to stay with your current scheme like you did for DateTime= and do a Path= and have things like [[Path=MyDocuments]] but allow all the A_ path variables.

A_MyDocuments is easy for me but Path= but might be more consistent for your non-AHK users.

For those comfortable with AHK, I would just add an ability for them to use AHK functions whether standard or custom.

Now that I think about it this could be something like [[AHK= ]] where anything after the = gets evaluated as an AHK expression so you could technically do something like [[AHK=Floor((A_DD+2)/2)]]. This alone would open up a ton of stuff for the power users including custom functions assuming you had a way to #include them like you do the plugins.

Now that I think about it, I could probably just do this under the current version just by writing a custom pluggin called "AHK".

Just thoughts off the top of my head.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

15 Nov 2017, 14:37

I'll have look through the list of variables and see what could be useful. Little point in adding A_GuiEvent for example.

I already got to the point so that you can simply call a function like [[function(parameters)]] it sees there is no = and then knows its a function.

Code: Select all

This is a test with a user [[func1(1,2,3)]] function and AHK [[SubStr("AutoHotKey",5,3)]] function
the result is (func1 just adds the numbers as a test to pass on parameters)

"This is a test with a user 6 function and AHK Hot function"

Pretty nifty if I do say so myself :D
User avatar
hoppfrosch
Posts: 443
Joined: 07 Oct 2013, 04:05
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

16 Nov 2017, 01:00

list wrote:I already got to the point so that you can simply call a function like [[function(parameters)]] it sees there is no = and then knows its a function.

Code: Select all

This is a test with a user [[func1(1,2,3)]] function and AHK [[SubStr("AutoHotKey",5,3)]] function
the result is (func1 just adds the numbers as a test to pass on parameters)

"This is a test with a user 6 function and AHK Hot function"

Pretty nifty if I do say so myself :D
Pretty cool 8-). it's funny: I'm currently working on a template mechanism for AutoHotkey V2, having a similar functionality is definitly on my plan!

Will have a look at your code - if you don't mind, I might "borrow" some ideas ;)
list-nli

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

16 Nov 2017, 03:38

@hoppfrosch funny you should say that - I've always thought it might be "useful" to separate the snippet+plugins processing from Lintalist as a standalone function/library. That way you could use it in other scripts by simply #include snippets.ahk

Code: Select all

::hotstring:: ; or hotkey
var:=snippet("Hello [[Input=Name]]")
return

#include snippets.ahk
Not sure if it is worth the effort to do so as I don't expect many people would use it. :think:
User avatar
hoppfrosch
Posts: 443
Joined: 07 Oct 2013, 04:05
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

16 Nov 2017, 05:21

Here here here! I would probably use it! ;)

I'm looking for a template system (written in AHK) to automate/simplify the generation of the awesome AHK-page on github. For sure this can easily be done in any other scripting language - but how awesome is AHK, if it's a major barrier to implement a templating system to generate the awesomeAHK-page? :lol:
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

16 Nov 2017, 12:29

hoppfrosch wrote:Here here here! I would probably use it! ... I'm looking for a template system (written in AHK) ...
It wouldn't be to hard to "extract" it from Lintalist but if you do so "as is" you'll have a quite few global variables which some wouldn't like, so transforming the labels to functions would be preferred to have a nice and clean solution. I'll put it on my list :shh:
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

17 Nov 2017, 14:59

For the adventurous: here is a development branch https://github.com/lintalist/lintalist/ ... -functions
  • support for user/ahk functions in snippets: [[SubStr("AutoHotkey",5,3]] -> Hot
  • support for subset of AutoHotkey built-in variables: A_MyDocuments etc
See the documentation "Functions" for a rudimentary introduction (docs needs some work)

I've also added some error checking* when processing snippets (plugins/functions) - this will avoid Lintalist to crash - if it finds a plugin/function it can't process it will wrap the that section of the snippet in {{braces}} so if you made a typo [[inpt=Name?]] or call a non-existing function [[MyFunk()]] it will become {{inpt=Name?}} {{MyFunk()}} so you can see there is an error in the snippet.

Suggestions and bug reports welcome :-0

* I should probably add some more by preventing snippets calling Lintalist functions as that could really mess things up but I haven't done so yet.
list
Posts: 221
Joined: 26 Mar 2014, 14:03
Contact:

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

01 Jan 2018, 04:56

v1.9.4 functions, AHK variables, editor w. syntax highlighting
https://github.com/lintalist/lintalist/releases
  • New: Functions in Snippets are now also allowed: [[function()]] - both AHK built-in as user defined - #86 https://github.com/lintalist/lintalist/issues/86
  • New: support a subset of AutoHotkey built-in variables (A_MyDocuments etc)
  • New: Additional safety check when processing snippet by "removing" faulty plugins plus a simple error check when saving snippets.
  • New: Editor now has (optional) Syntax highlighting (plugins, html, scripts) by using the RichCode class by @G33kDude - #88 https://github.com/lintalist/lintalist/issues/88 (when using RichCode you can toggle word wrapping in the edit controls by pressing ctrl+w)
  • Fix: Editor - "Edit in Editor" routine improved, notepad.exe may not show ".txt" in Window title, and actually delete "__tmplintalistedit.txt" file in tmp folder (didn't do so correctly)
  • Change: User plugins (and now functions) can be added to MyPlugins/MyFunctions so future updates of Lintalist won't overwrite plugins/functions added by users each time. See NOTE below.
  • Fix: Closing Input and Choice plugins via close button (x) in Gui now properly cancels snippet
  • New: added icons to Tray menu and some Search menu entries.
NOTE

User plugins/functions must now be included in plugins\MyPlugins.ahk and plugins\MyFunctions.ahk and no longer in `plugins\plugins.ahk`. Future updated will not overwrite these two files. More information and samples in https://raw.githubusercontent.com/linta ... -howto.txt
This readme also includes the example provided by FG.
User avatar
kunkel321
Posts: 972
Joined: 30 Nov 2015, 21:19

Re: Lintalist 1.9 Searchable interactive lists to copy & paste text with plugins

19 Jan 2018, 20:30

Hey does anyone know for sure if Lintalist works with Win 10?
If I make a new snippet, it doesn't get saved:
---------------------------
Error
---------------------------
ERROR: Could not append snippet to Bundle

C:\Users\swkunkel\Google Drive\AHK 2018\lintalist\bundles\default.txt

- LLPart1: This is my sample input.
LLPart2:
LLKey:
LLShorthand: samp
LLScript:
---------------------------
OK
---------------------------
Also, bundle editor doesn't seem to do anything. The GUI shows, but if I add a new bundle, then reopen the editor, the bundle has not been saved (doesn't show up in list).

Thoughts?
ste(phen|ve) kunkel

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: JoeWinograd, TOTAL and 141 guests