fix-outlook-line-breaks.ahk - how to get it working?

Post your working scripts, libraries and tools
ahwul62
Posts: 6
Joined: 12 Nov 2017, 08:11

fix-outlook-line-breaks.ahk - how to get it working?

20 Jan 2018, 08:29

Up front, I have no knowledge about scripting and how exactly to use autohotkey.

In the past I have been using 1 single script to solve an issue.
That was working fine for a long time and actually I didn't look at it.
However, after after some updates and a clean Windows install and even though I -think- I have installed autohotkey and the .ahk file as before
(I made screenshots of the steps at the time) the script doesn't work.

I am seeking a helping hand as to how I should proceed to get it working.

1. Windows 10 x64 latest version (1709)
2. I installed the x64 version of the latest Autohotkey
3. the fix-outlook-line-breaks.ahk is in the Autohotkey folder
4. Copy-Pasted fix-outlook-line-breaks.ahk as a shortcut in
C:\Users\UserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Contents of the autohotkey folder: see screentshot

-

SnagIt-20012018 142014.png
SnagIt-20012018 142014.png (37.28 KiB) Viewed 290 times


-


Contents of the .ahk file, see below.

Issue:
a) Autohotkey.exe seems not to be loaded (the button does not show up in the taskbar)
b) So the .ahk file is not loaded
c) with I rightclick run as admin the ahk file, the Autohotkey button shows up in the taskbar

But there is no change in behavior when hitting the 'Enter'-key.
When I send something to gmail and back I get it back with double line spacing (in case of using 'Enter' only)
Shift enter works fine though.

What am I doing wrong?
Should I install the 32bit version? (during setup the x64 part was already 'pre-selected', so I used that)

Thanks!


=
fix-outlook-line-breaks.ahk
#NoEnv
#SingleInstance force
SetTitleMatchMode 2
SendMode, Input
Return
^esc::exitapp
#IfWinActive, - Bericht
$+Enter::Send, {Enter}
$Enter::Send, +{Enter}
$+NumpadEnter::Send, {Enter}
$NumpadEnter::Send, +{Enter}
User avatar
Nextron
Posts: 1142
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: fix-outlook-line-breaks.ahk - how to get it working?

20 Jan 2018, 09:21

ahwul62 wrote:a) Autohotkey.exe seems not to be loaded (the button does not show up in the taskbar)
Does it show up in the overflow area (after you click the triangle left of all the icons)?
c) with I rightclick run as admin the ahk file, the Autohotkey button shows up in the taskbar
But there is no change in behavior when hitting the 'Enter'-key.
When I send something to gmail and back I get it back with double line spacing (in case of using 'Enter' only)
Shift enter works fine though.
Your script only works for windows containing the phrase "- Berichten" in the title caption. Are you still using the Dutch (?) version of Outlook, or perhaps a newer version that doesn't have that phrase in it anymore?
Should I install the 32bit version? (during setup the x64 part was already 'pre-selected', so I used that)
Doesn't matter in this case.
The more I know:
The more I know,
I know nothing.
ahwul62
Posts: 6
Joined: 12 Nov 2017, 08:11

Re: fix-outlook-line-breaks.ahk - how to get it working?

21 Jan 2018, 02:28

Thanks for the reply!
No, it does not show up there. In Windows - > Taskbar Settings -> Notification Area -> Select which icons ...
I have 'Always show all icons in the notification area' : ON (Autohotkey isn't listed there).

By default I use the Dutch version of Outlook 2016, but may change to the English version if needed (e.g. when I wish to update Office settings, in line with English step-by-step guide).

Note that by double clicking the ahk file, autohotkey will show up in the taskbar, but it does not work.
I changed 'Bericht' to 'Berichten' - that did not help either

FWIW the window title reads
-
SnagIt-21012018 082408.png
SnagIt-21012018 082408.png (1.5 KiB) Viewed 254 times

-
ahwul62
Posts: 6
Joined: 12 Nov 2017, 08:11

Re: fix-outlook-line-breaks.ahk - how to get it working?

21 Jan 2018, 02:37

Later... I -removed- the line: #IfWinActive, - Bericht
so the script now reads:

fix-outlook-line-breaks.ahk
#NoEnv
#SingleInstance force
SetTitleMatchMode 2
SendMode, Input
Return
^esc::exitapp
$+Enter::Send, {Enter}
$Enter::Send, +{Enter}
$+NumpadEnter::Send, {Enter}
$NumpadEnter::Send, +{Enter}

now indeed one I hit the [Enter] key a paragraph break shows up

-
SnagIt-21012018 083617.png
SnagIt-21012018 083617.png (3.37 KiB) Viewed 253 times

-

Now, one thing is still left: how to have autohotkey run at startup?
I pasted the .ahk as shortcut in the startup folder (see my earlier post)
ahwul62
Posts: 6
Joined: 12 Nov 2017, 08:11

Re: fix-outlook-line-breaks.ahk - how to get it working?

21 Jan 2018, 03:47

Later:
Autohotkey.exe, properties, tab: Compatibility : tagged 'Run this program as an administrator"
did the same for AutohotkeyU64.exe (don't know if that matters, probably not)
did the same for fix-outlook-line-breaks shortcut in \startup folder, r-click, advanced, tagged 'Run as administrator'.
Rebooted of course

Autohotkey v1.1.27.04 x64
Windows 10 x64 (1709, build 16299.192)

AFAIK there are no AV-issues (nothing in quarantine or so, after all I can launch the .ahk or shortcut manually)
User avatar
Nextron
Posts: 1142
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: fix-outlook-line-breaks.ahk - how to get it working?

21 Jan 2018, 07:57

4. Copy-Pasted fix-outlook-line-breaks.ahk as a shortcut in
C:\Users\UserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Since this should be the correct path to autorun applications, I wondering whether 'Username' refers to your actual username? Are there any other folders in the folder C:\Users\? Perhaps your user number if it's a corporate computer?

Later... I -removed- the line: #IfWinActive, - Bericht
Good that it works now, but it's active for every application now, which may cause undesired effects. Run WindowSpy.ahk and activate a new Outlook e-mail message window, now copy and paste to contents of the top text field of the Window Spy dialog here (with the ahk_class and ahk_exe), so we can correct that line.
The more I know:
The more I know,
I know nothing.
ahwul62
Posts: 6
Joined: 12 Nov 2017, 08:11

Re: fix-outlook-line-breaks.ahk - how to get it working?

21 Jan 2018, 08:22

I merely replaced my name with 'username' for privacy reasons. Nothing special.
It also works in Word, which is okay. I believe it won't work other editors (like text editors, or the text boxes in forums)

As for WindowSpy.ahk
before starting/using it, what is it supposed to do?

Could there be any issues with Windows 1709 ?

-
User avatar
Nextron
Posts: 1142
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: fix-outlook-line-breaks.ahk - how to get it working?

21 Jan 2018, 09:30

I figured 'Username' is not your actual name, but it's strange the shortcut doesn't run on startup. That's why I was thinking you may have been using the wrong user's startup folder (for my corporate laptop, the 'username' folder does not match my login username).

Window spy just shows some information about the active window you can use to fix the #IfWinactive line. But if it works ok, no need to change it.
Screenshot of old version:
Image
The more I know:
The more I know,
I know nothing.
ahwul62
Posts: 6
Joined: 12 Nov 2017, 08:11

Re: fix-outlook-line-breaks.ahk - how to get it working?

21 Jan 2018, 10:26

FWIW - I uninstalled autohotkey and re-installed it with admin rights - deleted the shotcut in startup and created a new one
rebooted.
Nothing... :-(

when I rightclick on the .ahk file - I see a 'Compile Script' option. I don't know what it is and it gets pretty vague for me.
So I tried it - whatever ..
I got a .exe file.
Maybe I should put that in the startup folder then?

-
SnagIt-21012018 162315.png
SnagIt-21012018 162315.png (21.94 KiB) Viewed 209 times

-

If not, well, I forget about it then. It doesn't work, at least it doesn't load automatically. Too much time spent on this small issue.
User avatar
Nextron
Posts: 1142
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: fix-outlook-line-breaks.ahk - how to get it working?

21 Jan 2018, 15:21

I wouldn't see how that's going to make a difference. Your script works when you start is manually but doesn't auto-start. So I'd first start looking whether it is started in the first place. Are there any other shortcuts in the startup folder that are executed? If not, place a shortcut to notepad or something in there, and see if it is started when you reboot.
The more I know:
The more I know,
I know nothing.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 16 guests