This macro is not obsolete? Copy TEXT from web as linked RTF

It turned out the old macro from 2015 was obsolete.

However, a pretty decent upgrade by @Nige_S is here:


Vs. Copy2
This is a previously functioning TEXT - URL (NAME AND URL AS HTML LINK) macro, that as it is renders the URL (as HTML link) but not the text.

I somehow coughed up a different version (Copy3) that renders the text only, but I'm unable to understand what is happening, but I could upload it, too, if necessary.

This macro is from Jul 15, 2015, by

Copy2 from web as linked RTF (Ver 1.1) Macro (v11.0.4)

Copy2 from web as linked RTF (Ver 1.1).kmmacros (37 KB)

My result is:

You seem to have lost the Action from the Safari section that sets the "Web Clip" Named Clipboard -- but you have two of them in the Chrome section, so perhaps you've accidentally dragged one across.

That would explain things if you expect your dialog to have the text selected in the web browser instead of "Empty Clipboard Text".

1 Like

I can't see where the "Web clip" Clipboard is used, in Safari at least it shows an old Clipboard from yesterday.

However, I somehow managed to get it work perfectly in G Chrome!

this is the macro "Copy2b"

Copy2b from web as linked RTF (Ver 1.1b) Macro (v11.0.4)

Copy2b from web as linked RTF (Ver 1.1b).kmmacros (37 KB)

Also, why would there be these 2 webclip tasks:

/okn

In both the "Set Named Clipboard 'Temporary'..." and the "Display text" Actions -- the %NamedClipboard%Web Clip% tokens.

Probably the value from the last time you ran the macro with Chrome frontmost.

I'll stand by my earlier guess -- you've accidentally moved one of them from the Safari section into the Chrome section. Move the first one, "Copy System Clipboard to Named Clipboard..." to between the Safari "Copy" and "AppleScript" Actions.

This is not yet the correct (restored) version of the original macro (hopefully, if someone can test it).

Webclip actions seem to be both necessary, when I deactivated one or the other, the macro did work at first, but 10min later the Text (webclip) was not rendered, instead the HTML URL.

Copy5a from web as linked RTF (Ver 1.1d).kmmacros (36 KB)

Thank you!

/okn

Wish everyone a good New Year, with less wars and less lies (optimistic).

This thing is still not finished.

Display Text "%NamedClipboard%Web Clip%.." in Window
= ok

then the Set Named Clipboard "Temporary" to Styled Text

only renders the HTML URL !

What is going on here?

/okn

You'll need to fully describe

  1. What you are doing
  2. What result you expect
  3. What result you actually get

...because, for me with part of your post's text selected:

Safari

Chrome

...which would seem to be correct.

Have you tried to paste to a textfile?

No, because you've not said how you intend to do the pasting.

If it's another macro that pastes the contents of "Temporary" Named Clipboard it should work just fine. If you expect to be able to paste from the System Clipboard then you're going to have to set that to the contents of "Temporary" (or change the "Set Named Clipboard 'Temporary'..." Action to "Set System Clipboard", if you never use "Temporary").

1 Like

Here is the almost everything ready version…
→ ENCODE DIACRITICS AND SPECIAL CHARACTERS
not working at all, see next post.

Copy6a from web as linked RTF (Ver 1.1f).kmmacros (36 KB)

/okn

Seems the ENCODE DIACRITICS AND SPECIAL CHARACTERS is not rendering the page title correctly.

	-- ENCODE DIACRITICS AND SPECIAL CHARACTERS
	set lstChars to characters of strEncoded
	repeat with i from 1 to length of lstChars
		set lngCode to id of item i of lstChars
		if lngCode > 127 then set item i of lstChars to ("&#" & lngCode as string) & ";"
	end repeat
	lstChars as Unicode text
end EscapeChars

To my knowledge, I have not touched the AppleScript code.

How it looked with the original macro, which seems to be lost.

Can be test with this page f ex.

/
best regards,
OmarKN

The original is here, but in my testing has the same problem you're seeing.

Otherwise -- continued in your other thread.

1 Like