Would use of Variable simplify this macro?/ get webpage Safari / Chrome Macro

Last viewed webpage Safari / Chrome Macro (v10.0)

Originally I started out "Example Creating Variable which uses Token, by JMichaelTX" ( ) on YouTube. Often I also want to copy some text from a webpage.

Question: How would one do it better with a variable?

/
Any assistance would be greatly appreciated!

With best regards,
Omar KN

(This is also meant as a learning example.)
(Now that my AppleScript macros are broken - ).

Last viewed webpage Safari - Chrome.kmmacros (7.6 KB)

Display-Macro-Image

I don't know if it's any better, but you could refactor the macro so that it puts either the Safari or Chrome info into a variable in the "If..." action so that you have only one set of TextEdit operations. Pre-populating the the variable with the date and time strings will also make it easier to change later as it's only in one place:

Last viewed webpage Safari : Chrome.kmmacros (6.6 KB)

Image

1 Like

Very good, sleek solution, thank you Nige_S.

Didn't know about 'appending variables'.

The forum here is great, but maybe some real-life examples with variables would be good. (not the least - related to text editing & storing… - in my case.)

/
with best regards, Omar KN, Sweden