Pages

Showing posts with label Coding. Show all posts
Showing posts with label Coding. Show all posts

2025/01/16

AutoHotkey (FREE) – Change Size and Position of The Active Window with Hotkey on Windows 11

I wanted to use a macro recorder to make my life easier but the problem was size and position of window must be the same every time in order to click or type at the right spot.


All of the free apps I had tried have no ability to serve me. I have to use AutoHotkey for this job

 

The test steps – AutoHotkey 1.1.37.02

On: Windows 11 Home

Download: https://www.autohotkey.com/

 

1. Go to the link above and download version 1.1.


Click the ‘Download’, you will see the options.

Open the downloaded file to install the app.


2. Open new document of Notepad.

 

^+w::

WinGetPos, X, Y, W, H, A

MsgBox, X, Y, W, H of the active window: %X%`, %Y%, %W%, %H%

 

Copy the code above (orange font), then paste it to Notepad.

This code is for getting size and position of active window by pressing

Ctrl+Shift+W.

You can change ‘w’ to the other. If I change it to ^+p, Ctrl+Shift+P is my hotkey.

Please take a look at the last line. After %X%, there is `. That is the code, not a typo.

Save a document and set the extension to .ahk.

3. Set the size and position of a window of Notepad the way you want.

Open the .AHK file.



Click an arrow at taskbar, you will see .AHK file (see picture above). That means it is running and detecting keystrokes. Whenever you press hotkey, message box will show values of size and position of active window (see picture below).


4. We have values of X, Y, W, H. The next step is the code for changing the size and position of active window.

 

^+z::WinMove, A,, 489, 192, 907, 572

 

From the code, you can change 358, 121, 1331, 818 to size and position you want.

Whenever you press Ctrl+Shift+Z, the size and position of the active window will be set.

You can change z to the other in ^+z

It’s time to do the same steps: copy the code above > create a new document of Notepad > paste it to Notepad > edit the code > save it > set the extension to .ahk > open a .AHK file.

Then make a target window active and press hotkey to change size and positon.


That’s it for this post. The next post I’ll show you the free app I use for recording macro.

 

The test steps – AutoHotkey 1.1.37.02

On: Windows 11 Home

Download: https://www.autohotkey.com/

 

2024/11/18

Insert Multiple Cursors and Make a Multiple Selection in Sublime Text (FREE)

In the picture below. Please read the last two lines.


If I understand it right, when I use it for a period of time and I don’t buy it, there is a small window saying “buy Sublime or something like that”, I click to close that window. Then I continue using it without any problem.


The test steps – Sublime Text (Unregistered) Stable Channel, Build 4169

On: Windows 11 Home

Download: https://www.sublimetext.com/download

1. Just hold ‘Ctrl’ key while clicking to place cursor at any location.


Press ‘Esc’ to cancel.


In the picture above, When I pressed ‘Esc’ at the keyboard, a cursor is at the last location I clicked.


You can type.


You can delete.


If you want to make a multiple selection, hold ‘Ctrl’ key while selecting text.

Press ‘Esc’ to cancel


After multiple selections are made, if you type something, text that are selected will be replaced. In the picture above, I typed ‘abcd’.


If you press ‘Backspace’, text that are selected will be deleted.

That’s it for a small thing that will help you get it done faster.

 

The test steps – Sublime Text (Unregistered) Stable Channel, Build 4169

On: Windows 11 Home

Download: https://www.sublimetext.com/download

 

2024/03/19

Atom (FREE!) - Delete Multiple Characters at Once with 'Multiple Cursors' on Windows

The input in this post is from the output of 'Snipping Tool'.

 

Converting newspaper image to text, the result are columns, sometimes there are many hyphens joining words between lines. If you convert a column to single line, you do not need those hyphens.


 'Multiple Cursors' of Atom comes to help in this case.


The test steps - Atom 1.60.0 ia32
OS: Windows 11 Home
Download from the developer's website: https://github.com/atom/atom/releases


1. Go to the link above, then expand the 'Assets' section of the target version, then click to download a version for Windows.

 

Unzip the downloaded file. There are 2 folders, open folder 'Atom'.

Open file 'atom'. There are tabs -- 'Welcome' and 'Welcome guide'. You can close them.

2. Click menu 'File' --> 'New File'. Save it.

Past text.

In the picture above, you will see hyphens.

After the lines are joined ,there are hyphens. If you want to know how to join lines with Atom, read my previous post. -->  https://windowsfreewareguide.blogspot.com/2024/03/atom-free-join-multiple-lines-on-windows.html


You might want to wrap text to make things easier. Click the line number to select that line.

In the picture above, from line 2 to the last line were joined so I clicked line 2 to select. Then click menu 'View' > 'Toggle Soft Wrap'.

The result is below.


In the picture above, I will show you how to delete space and hyphen in intimi- date. And Emer- gency and others.

Change the current position of the cursor to the right place. In my case, I placed the cursor before character 'd' of intimi- date.


Then hold Ctrl key while clicking to place the cursor at other positions. The result is below.

Then I pressed Backspace key two times. The result is below.

Press Esc key, there will be one cursor.

The current position of cursor is the first position before the 2nd cursor is placed.


With the power of this code editor you can get it done fast.

The test steps - Atom 1.60.0 ia32
OS: Windows 11 Home
Download from the developer's website: https://github.com/atom/atom/releases

2024/03/11

Atom (FREE!) - Join Multiple Lines on Windows

I was looking for this feature because I wanted to join multiple lines from converting an image to text with 'Snipping Tool'.

 

If you have to do this task very often, try using Atom. The power of code editor makes jobs done fast.


Don't worry because you don't have to be a coder. Believer me!



The test steps - Atom 1.60.0 ia32
OS: Windows 11 Home
Download from the developer's website: https://github.com/atom/atom


1. Go to the link above.


Click 'Latest'

At 'Assets', download 'atom-windows.zip'.

Unzip the downloaded file. There are 2 folders, open folder 'Atom'.

2. Open file 'atom'. There are tabs -- 'Welcome' and 'Welcome guide'. You can close them.


Click menu 'File' --> 'New File'.


The status bar at the bottom shows 'Plain Text'. If you want to try other formats, click 'Plain Text'.



The search box shows, you can search and select the format.

Save the document.


Select lines that you want to join.

Click menu 'Edit' --> 'Join Lines'.

In the blink of an eye, the output showed. In the picture above you can see the line number, there are 2 lines not 3. Thanks to the power of code editor.

The test steps - Atom 1.60.0 ia32
OS: Windows 11 Home
Download from the developer's website: https://github.com/atom/atom