Some help sending OPML code snippet

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Tim_H
Posts: 16
Joined: 05 Aug 2021, 19:43

Some help sending OPML code snippet

15 Oct 2023, 20:57

I want to set a shortcut for use in the Workflowy app.

Desired result:
shift + enter pastes the following code in the program:
<?xml version="1.0"?>
<opml version="2.0">
<body>
<outline text="&#10;&#10;" />
</body>
</opml>
I tried a few different ways to get this working in AutoHotKey, but none of them do the trick.

Disclaimer: I am a total newbie and the above code is not mine – I copied it from a Workflowy forum here


Among other things, this is what I tried:

Code: Select all

#ifWinActive ahk_exe Workflowy.exe

		+Enter::
		Send,<?xml version="1.0"?>
		Send,<opml version="2.0">
		Send,<body>
		Send,<outline text="&#10;&#10;" />
		Send,</body>
		Send,</opml>
		return

#IfWinActive
Any help would be greatly appreciated!
Last edited by gregster on 15 Oct 2023, 21:01, edited 1 time in total.
Reason: Moved topic from AHK v2 help to v1 help, due to the posted code.
Rohwedder
Posts: 7768
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Some help sending OPML code snippet

16 Oct 2023, 01:32

Hallo,
try:

Code: Select all

#ifWinActive ahk_exe Workflowy.exe

	+Enter::Send, {Text}
	( LTrim
		<?xml version="1.0"?>
		<opml version="2.0">
		<body>
		<outline text="&#10;&#10;" />
		</body>
		</opml>
	)

#IfWinActive
Tim_H
Posts: 16
Joined: 05 Aug 2021, 19:43

Re: Some help sending OPML code snippet

17 Oct 2023, 18:53

Hello @Rohwedder,

Thanks for your help! Unfortunately, this doesn't seem to work. :/

What does the LTrim function mean exactly?

Here's the desired OPML code one more time:

Code: Select all

<?xml version="1.0"?>
<opml version="2.0">
  <body>
    <outline text="&#10;&#10;" />
  </body>
</opml>
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: Some help sending OPML code snippet

17 Oct 2023, 20:01

Code: Select all

#Requires AutoHotkey v1.1.33

#If WinActive("ahk_exe Workflowy.exe")
+Enter::
SendInput,
(
<?xml version="1.0"?>
<opml version="2.0">
  <body>
    <outline text="&{#}10;&{#}10;" /{Esc}>
  </body>
</opml>
)
Return
#If
Tim_H
Posts: 16
Joined: 05 Aug 2021, 19:43

Re: Some help sending OPML code snippet

23 Oct 2023, 14:15

Hello @mikeyww,

Thanks for your help! Unfortunately it still doesn't work. :(
Here's a screenshot from Workflowy:
image.png
image.png (12.27 KiB) Viewed 358 times

You mentioned I needed a specific version of AHK, though. I tried checking which version I have, but can't seem to find it anywhere.
Can you guide me? :o

Thanks!
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: Some help sending OPML code snippet

23 Oct 2023, 14:48

If the only issue is indentation, then you might need to adjust that in the program or the script.
just me
Posts: 9574
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Some help sending OPML code snippet

24 Oct 2023, 04:46

Maybe

Code: Select all

#If WinActive("ahk_exe Workflowy.exe")
+Enter::
SendInput,
(Join`r
<?xml version="1.0"?>
...
Tim_H
Posts: 16
Joined: 05 Aug 2021, 19:43

Re: Some help sending OPML code snippet

24 Oct 2023, 17:14

Hello @mikeyww, Thanks for staying with me! 😉

Unfortunately, this seems to give a similar result...

Eh... Any more ideas? 🙄
User avatar
mikeyww
Posts: 27366
Joined: 09 Sep 2014, 18:38

Re: Some help sending OPML code snippet

24 Oct 2023, 19:28

I would see whether there are any program configuration options for indentation. That is my only thought.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mstrauss2021 and 293 guests