topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 25, 2024, 2:09 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Lintalist [ switch to compact view ]

Pages: prev1 2 3 4 [5]
101
Post New Requests Here / Re: Move/Organize Files Into Folders
« on: March 26, 2016, 09:48 AM »
I don't know if you are familiar with AutoHotkey, a useful script language, you can find it here http://autohotkey.com/

This script should work (be sure to make a backup and be careful which folders you use)

The DIR command (MS Dos) has a useful SORT by size option so we make use of that to create a list of files sorted by size first, then read the list and parse it and create the folders when we need them to move the files into it. Again use at your own risk and be careful which folders you try it out on. You can compile this script into a exe and also have it read some settings from an INI file if that is useful by using the AutoHotkey IniRead command. You can also dress it up with a GUI and progress bars and what not, this is just a bare bones script.

Code: Autohotkey [Select]
  1. SetWorkingDir, %A_ScriptDir%
  2.  
  3. Counter:=0
  4. FilesPerFolder:=100
  5. Folder=c:\test\ ; set folder here or uncomment the lines below by removing the ; so you can select a folder
  6.  
  7. ;FileSelectFolder, Folder, , 0, Select folder
  8. ;If (Folder = "")
  9. ;       ExitApp
  10.  
  11. Folder:=RegExReplace(Folder, "\\$")
  12.  
  13. ; make a list sorted by size, type DIR /? at a command prompt for more options.
  14. RunWait, %ComSpec% /c dir %Folder% /b /OS > $$filelistsortedbysize.tmp, , Hide ; use /O-S if you want to sort from large to small
  15. FileRead, FileList, $$filelistsortedbysize.tmp
  16. Sleep 100
  17.  
  18. TargetFolder:=SubStr("00000" ++Counter, -4)
  19. FileCreateDir, %Folder%\%TargetFolder%
  20.  
  21. Loop, Parse, FileList, `n, `r
  22.         {
  23.          ; MsgBox %Folder%\%A_LoopField%`n%Folder%\%TargetFolder% ; debug msgbox so we can see what is going on
  24.          FileMove, %Folder%\%A_LoopField%, %Folder%\%TargetFolder%
  25.          If (Mod(A_Index,FilesPerFolder) = 0)
  26.                 {
  27.                  TargetFolder:=SubStr("00000" ++Counter, -4)
  28.                  FileCreateDir, %Folder%\%TargetFolder%
  29.                 }
  30.         }
  31.  
  32. FileDelete, $$filelistsortedbysize.tmp
  33.  
  34. MsgBox Done!
  35.  
  36. ; Esc::ExitApp ; if you want to be able to stop the script at any time by pressing Esc remove the ;

102
fSekrit / Re: Open-sourcing fSekrit
« on: February 12, 2016, 05:16 PM »
 :Thmbsup:

103
Do you only want to retain the information in the Child window and keep it on screen while you dismiss it and continue to work in your program?
If so, you can try and see if AHK can read the information (assuming it is text) from the Window and display it in a alwaysontop AHK gui.

Or if not "clone" the window as an image and display it as such (could again be an AHK GUI or use GDI+ to display the image - you can also use GDI+ to "clone" or "copy" the window as image.

104
v1.7 is now available. You can use the tray menu, check for updates, to upgrade, or download it manually via https://github.com/l...t/lintalist/releases

  • New: SearchLetterVariations setting - Allow for variations of letters in search query - 'e' also searches for 'eéèë...' etc
  • New: SnippetEditor Setting - Allow user to set editor to use for "Edit in Editor".
  • New: PlaySound Setting - Play sounds after paste, open or close of Search Gui (beeps, default Windows media or user files).
  • New: Added help menu with 'Help' and 'About' options to the GUIs and added 'About' to tray menu.
  • New: Split plugin now accepts "named Split" [[split_name]].
  • Fix: Tray menu: manage bundles and manage local variables weren't working.
  • Fix: Always resolve Vars in nested situations.
  • Various other minor fixes, code refactoring and documentation.
Upgrading:

  • If you are upgrading to this new release, you can use the tray menu option "Check for updates" and have it done automatically.
  • If you prefer to do it manually, please use the following procedure:
    • close your running copy of Lintalist first
    • unpack the zip file and overwrite all files. Note: any (changed) bundles and settings will not be overwritten




A quick note about the "named splits" - just in case you're wondering how useful the [[split]] plugin is, here is a short example how you can use it to create a Snippet with "logic".
You can use Choice (or another Plugin) to select an item and use that output to update other parts of the snippet.

[[Split_C1=[[choice=1   Option1|2   Option2|3   Option3|4   Option4]]|\t]]
[[Split_CSub=sub1 sub2 sub3 sub4|\s]]

You made Choice Number [[SP_C1=1]]
And the sub-selection that goes with it is:
[[SP_CSub=[[SP_C1=1]]]]

This will ask you to make a Choice from Option1..4, and if you pick Option3 it will use "3" as a selection criteria for another Split.
So if the above snippet would have the following output (if you select Option3):

You made Choice Number 3
And the sub-selection that goes with it is:
sub3

Another example can be found here http://lintalist.git...b.io/#combiningsplit

105
You can keep your own domain but host your (zipped) executable(s) on GitHub? Either directly in your repo or better yet as releases, let them foot the bill for the downloads :-)

106
Good to hear it works. 8)

1: Yes.
2: Like so: replace /k with /c and add ,,Hide
RunWait %comspec% /c rarselect.cmd,,Hide
3: I don't know how it actually works (I don't want anything)
4: Yes most certainly:

The recommended browser would be IE so you can reliably automate the process. Other browsers: can be done but would have to rely on sending text to each field in the form similar to copy/paste manually.

With IE & COM you can actually SET the text of each field which will be much more reliable.
Some tutorials (looks a bit daunting I'll admit):
https://autohotkey.c...script-com-tutorial/ and
https://autohotkey.c...c.php?f=7&t=7822 - some info/posts on the AutoHotkey forums will tell you need AutoHotkey_L but that is now the main branch of AutoHotkey which you already have so don't worry about that part.

For help on IE & COM related scripts is best to post them at https://autohotkey.com/boards/ as there are a few experts there that will be able to assist (if you put the effort in).

107
Lets try it slightly differently by creating a batch file with all files and then run that file, that way you can test / tweak it until you have it working.  The same principle as above, but it create a batch file with one line commands and it calls rar from c:\program files\winrar\rar.exe which I've just tested and it works for me here. You can check the batch file rarselect.cmd to see if there are any mistakes in there.

#NoEnv
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir%

if not A_IsAdmin
{
   Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
   ExitApp
}

; ----------

Password:="MyPassword"

#IfWinActive ahk_exe everything.exe
#z:: ; Winkey-z
ClipboardSave:=ClipboardAll
Clipboard:=""
; Ctrl-Shift-C = Copy full name to Clipboard
Send ^+c
Sleep 100
ZipTheseFiles:=Clipboard
Clipboard:=ClipboardSave
ClipboardSave:=""
Loop, parse, ZipTheseFiles, `n, `r
{
SplitPath, A_LoopField, OutFileName, OutDir, , OutNameNoExt
; a is just archiving, replace 'a' with 'm' if you want to delete (move) the files after creating the rar
ZipOutput .= """C:\Program Files\WinRAR\Rar.exe""" " a -ep -p" Password A_Space """" OutDir "\" OutFileName ".rar" """" A_Space """" A_LoopField """" "`n"
}
FileDelete, rarselect.cmd
FileAppend, %ZipOutput%, rarselect.cmd
RunWait %comspec% /k rarselect.cmd
ZipTheseFiles:="", ZipOutput:=""
Return

108
So it can't find rar.exe, what happens if you copy rar.exe to the folder where your autohotkey.ahk script it, and just use
RunWait, %comspec% /k rar.exe  a -ep -p%Password% "%OutDir%\%OutFileName%.rar" "%A_LoopField%"

109
Yes, you can debug it - just select one file for testing purposes. Replace '/c' with '/k' and remove ',,Hide' from the end, so like this
RunWait, %comspec% /k "C:\Program Files\WinRAR\Rar.exe" a -ep -p%Password% "%OutDir%\%OutFileName%.rar" "%A_LoopField%"

Don't forget to reload the script, right click on the tray icon and Reload.

What the above does:
- /k means don't close the Command window after the RunWait is done
- ,,Hide would hide the command.

Now you can see what the command line is and what type of error message if any is displayed.

110
The script actually checks if Everything is the active window. If it is you can press the Windows key + Z shortcut that will copy the paths of the selected files to the clipboard and then rar each selected file into its own RAR file.

At the moment it just archives them so you can test it out, if you're satisfied with the results of the script you can repalce the 'a' with 'm' so it will move the files to the archive.

See the RAR command line help for more info and options http://ss64.com/bash/rar.html

111
If you don't mind using AutoHotkey - http://autohotkey.com - you can use this script. It assumes the command line rar.exe is somewhere in your PATH. If you don't want to use or install AutoHotkey.exe you can compile the script into a Standalone exe (just remember that your password will not be protected by compiling the script). You can alter the script to read the password from an Ini file for example or ask the user to enter the password using a simple InputBox command.
#NoEnv
SetBatchLines, -1

if not A_IsAdmin
{
   Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
   ExitApp
}

; ----------

Password:="MyPassword"

#IfWinActive ahk_exe everything.exe
#z:: ; Winkey-z(ip)
ClipboardSave:=ClipboardAll
Clipboard:=""
; Ctrl-Shift-C = Copy full name to Clipboard
Send ^+c
ZipTheseFiles:=Clipboard
Clipboard:=ClipboardSave
ClipboardSave:=""
Loop, parse, ZipTheseFiles, `n, `r
{
SplitPath, A_LoopField, OutFileName, OutDir, , OutNameNoExt
; a is just archiving, replace 'a' with 'm' if you want to delete (move) the files after creating the rar
RunWait, %comspec% /c rar.exe a -ep -p%Password% "%OutDir%\%OutFileName%.rar" "%A_LoopField%",,Hide
}
MsgBox Done!
Return

112
Post New Requests Here / Re: Batch-edit images (remove frames)
« on: November 29, 2015, 03:00 PM »
I don't know if you are familiar with AutoHotkey - http://autohotkey.com - but you can read and edit images using GDI+
Luckily there is a library for that which makes things a lot easier.
I'm not very familiar with it but this is a proof of concept, still flawed, but should get you going.

You need:
- AutoHotkey, you can download it at http://autohotkey.com - it is a familiar program to many Donationcoders.
- You also need the GDI+ library, you can get at the links in the script below
- I also had to add the missing crop function, luckily Learning One made one so I copied it below

The demo script below almost works. I'll explain what it does:

- It reads/opens the image
- It gets the dimensions of the image, we need to know its height
- Then it reads the color of the pixels starting at the bottom of the image, that is why we needed the height
- If the pixel is white, move one pixel up, get the color and so on
- Once we find the first non-white pixel: bingo we now know how many pixel to crop from the bottom
- Crop the number of pixels from the bottom
- Save it to a new image

At the moment it looks for pixels that are 100% white. As you will notice that isn't a 100% accurate because it will "stop" reading pixels at a nearly white pixel. So there are things that would need to be fixed: a) it is probably better to look for a black pixel - if there is always a black border that is, and b) also take into account some variations of the color values of the pixel just to be sure.

Once you've got it working for one image, it is just matter of wrapping it in a loop, run the script, grab some coffee and lean back :-)

As you can see it stopped a bit to early as the pixel it found wasn't 100% white.
demo2.png

; get http://autohotkey.com
; https://www.dropbox.com/s/0e9gdfetbfa8v0o/Gdip_All.ahk if you have 64bit/unicode ahk
; or https://autohotkey.com/boards/viewtopic.php?t=6517 for others
; 4294967295 = 0xFFFFFFFF = white

pToken := Gdip_Startup()
pBitmap := Gdip_CreateBitmapFromFile("demo.jpg")

Gdip_GetImageDimensions(pBitmap,width,height)

Loop, % height
{
If (Gdip_GetPixel(pBitmap, 1, height-A_Index) <> 4294967295)
{
down:=A_Index
break
}
}
MsgBox % down

pBitmap2:=Gdip_CropBitmap(pBitmap, 0, 0, 0, down)
newfile:=A_ScriptDir "\demo2.png"
Gdip_SaveBitmapToFile(pBitmap2, newfile)
Gdip_Shutdown(pToken)
MsgBox Done

#include Gdip_All.ahk

; https://autohotkey.com/board/topic/29449-gdi-standard-library-145-by-tic/page-58
Gdip_CropBitmap(pBitmap, left, right, up, down, Dispose=1) { ; returns cropped bitmap. Specify how many pixels you want to crop (omit) from each side of bitmap rectangle. By Learning one.
Gdip_GetImageDimensions(pBitmap, origW, origH)
NewWidth := origW-left-right, NewHeight := origH-up-down
pBitmap2 := Gdip_CreateBitmap(NewWidth, NewHeight)
G2 := Gdip_GraphicsFromImage(pBitmap2), Gdip_SetSmoothingMode(G2, 4), Gdip_SetInterpolationMode(G2, 7)
Gdip_DrawImage(G2, pBitmap, 0, 0, NewWidth, NewHeight, left, up, NewWidth, NewHeight)
Gdip_DeleteGraphics(G2)
if Dispose
Gdip_DisposeImage(pBitmap)
return pBitmap2
}
/*
;Examples:
pCroppedBitmap := Gdip_CropBitmap(pBitmap, 10, 10, 10, 10) ; crops 10 pixels from each side of bitmap rectangle. Disposes of pBitmap.
pCroppedBitmap := Gdip_CropBitmap(pBitmap, 50, 50, 0, 0) ; crops 50 pixels from left and right side of bitmap rectangle. Disposes of pBitmap.
pCroppedBitmap := Gdip_CropBitmap(pBitmap, 0, 0, 77, 77, 0) ; crops 77 pixels from upper and lower side of bitmap rectangle. Does not dispose of pBitmap.
*/

esc::ExitApp

113
@tomos: I think for me it would be the simplicity and ease of use, I'm just interested in text not images, and 9 out 10 times I want something I just copied - not something I copied an hour ago. So I just bring up the menu, I usually spot the text I need very fast and type the letter of the item (I use a-z). It also brings the copied item back to the top of the list so if happen to need it again its right there.

So for me it is very fast and easy to use. There are many clipboard helpers but I find most cumbersome to use as there are too many options or I need to press to many keystrokes or even use the mouse or they "take" up too many hotkeys, are too buggy etc.

Before CLCL I used a very similar program on Windows 98(!) - it used the same menu approach, but it had some issues under Windows XP and then I found CLCL - so I didn't have to change the way I worked.

114
Just a heads up, a new beta is available, v1.7:

  • New: SearchLetterVariations setting -  Allow for variations of letters in search query - 'e' also searches for 'eéèë...' etc
  • New: SnippetEditor Setting - Allow user to set editor to use for "Edit in Editor"
  • New: PlaySound Setting - Play sounds after paste, open or close of Search Gui (beeps, default Windows media or user files)
  • New: added help menu with 'Help' and 'About' options to the GUIs and added 'About' to tray menu
  • Minor fixes and code refactoring.

I'd be interested to hear any feedback on the search results if you use this version, especially if they are unexpected or different from previous versions.
Adding SearchLetterVariations meant I had to change some underlying code for the various search methods which now makes more of use Regular Expressions which could mean results are different or displaying the results of a fuzzy search has become slower.
(For the PlaySound option: there are no sound files included, just look at sound.ini in the lintalist folder for instructions where to place them.)

Download the ZIP and unpack it to a folder of your choice:
https://github.com/l...list/archive/dev.zip

Feedback welcome: https://github.com/l.../lintalist/issues/49 or here of course.

115
Always nice to meet fellow AHK users :Thmbsup:

I saw some other threads where Lintalist was mentioned here on DC, for that reason I would like to highlight the note that is also in the documentation and website
Note: although Lintalist can expand abbreviations it is not intended to replicate or replace the native AutoHotkey Hotstrings features, see http://ahkscript.org/docs/Hotstrings.htm for an introduction and description of all the options.

For those interested, for some background (and a teaser) you can read my reply to a question by thiagotalma on GitHub here https://github.com/l.../lintalist/issues/32

116
@mwb1100: I think you'll be pleasantly surprised, Sumatra v3.0 has tabs - "The biggest change in this version is addition of tabs, contributed by Stefan Stefanov." http://blog.kowalczy...PDF-30-released.html :-)

117
Have you considered Tab Grenade, a firefox addon https://addons.mozil...x/addon/tab-grenade/ ?

118
PDF XChange Viewer for opening many PDFs (tabs!) and Sumatra in conjunction with Lister (the viewer in the shareware filemanager Total Commander).

119
Thanks. Glad you liked the post :-)

Edit: forgot to add that is a fully portable, it stores everything in the folder the program resides in (settings and bundles). When you run it for the very first time it does ask if you want a shortcut on your desktop or would like to automatically start it with Windows but if you answer don't do that you can run it from a USB drive or dropbox account for example.

120
Hello,

I think there are quite a few AutoHotkey users here on Donationcoder so I thought I'd post a note about my program here.

Website: http://lintalist.github.io/ - Source & releases: https://github.com/lintalist/lintalist/

Background: this is a program (script) I've developed and used for a long time. It was inspired by the Textmate Bundle/Snippet concept which a few years back was hardly available in a Windows text editor. Lintalist has the advantage it should work in any program (as long as it allows AutoHotkey to paste text) not just your editor. Some might compare it to the "tag list" or "clip libraries" you might find in some text editors as well.

Lintalist is an open source program written in AutoHotkey which allows you to store and (incrementally) search and edit texts in bundles and paste a selected text in your active program. The text can be interactive, for example you can automatically insert the current time and date, ask for (basic) user input or make a selection from a list etc and finally it can also run a script. You can use keyboard shortcuts or abbreviations to paste the text (or run the script) without opening the search window.
Bundles can be context sensitive and multiple bundles can be used at the same time (if they match the criteria).

If you write your text in HTML or Markdown you can paste formatted text (bold, italics, images, links etc) into your documents or emails. You can also directly read RTF or Images to paste as well.

Features:

  • A novel feature is the ability to use two parts of text depending on how your bundle is set up
  • Assign keyboard shortcuts to your favourite Snippets
  • Use abbreviations (shorthand) for your favourite Snippets (not meant to replace or compete with AHK hotstrings)
  • Run scripts which can be included in a Bundle
  • Standard Plugins:
    • Set caret position after pasting
    • Insert date & time (incl. math operations)
    • Pick date or date range from a Calendar
    • Choose item from a list
    • Use counters
    • Use selected text
    • Use the clipboard
    • Insert text from a file
    • Chain snippets (insert the contents of one snippet into another snippet)
    • Insert a character
    • Calculations
    • Use local variables
    • Split text into parts to reuse
       

Search window:



1. Type query (multiple search modes)
2. Menu + search options.
3. Result list with Part 1, Part 2, Key(board shortcut), Short(hand, abbreviation). Columns are dynamic, if part 2, key or short are not present in the loaded bundle(s) they will not be displayed.
4. Preview of top most or selected snippet text. In statusbar: loaded bundle(s) and hits / number of snippets.

Videos (not the best of quality, YT reduces the quality I'm afraid after uploading)

1. Introduction: http://youtu.be/XfjZPAhHB8c
2. HTML/Markdown: http://youtu.be/Q6SFkttjUQk
3. Formatted text: http://youtu.be/J1StUarGHmI
4. Plugins: http://youtu.be/Rtd_ChyRVkM

Notes:

Some example bundles are available here https://github.com/lintalist/lintalist-bundles/ simply copy these to the Bundles\ folder and restart Lintalist - right click tray menu.

The release (see GH) contains lintalist.exe - it is simply a renamed autohotkey.exe included for convenience.
In order for Lintalist to run scripts it needs a copy of AutoHotkey - Lintalist is not meant to be compiled.

Feedback is always welcome!

Website: http://lintalist.github.io/ - Source & releases: https://github.com/lintalist/lintalist/

Edit2: forgot to add that is a fully portable, it stores everything in the folder the program resides in (settings and bundles). When you run it for the very first time it does ask if you want a shortcut on your desktop or would like to automatically start it with Windows but if you answer don't do that you can run it from a USB drive or dropbox account for example.

Pages: prev1 2 3 4 [5]