okn
January 6, 2023, 8:10pm
1
Often I get some correct output from macros as here (from an AppleScript), but how to convert this text output to another style/ size?
The AppleScript writes very fast the text output (here the date) to a clipboard (clipboard 7).
If it could write it to a variable instead, which then can be used and styled?
If this makes sense?
/
with best regards, Omar KN, Sweden
Hey Omar,
Look at the pop-up menu that says "save results to clipboard " – you'll find an option to save to variable.
Your AppleScript is doing the job of pasting, so there's no way to alter the style of the text – unless of course you want to learn how to manipulate attributed strings with AppleScriptObjC.
Here'e how to do this job with Keyboard Maestro:
Insert Current Date.kmmacros (1.5 KB)
To change the style of the text you can get sneaky...
Insert Current Date.kmmacros (2.4 KB)
Change the actual font of the text in the paste action.
Note that the actions above are different – one pastes plain text, and one pastes styled-text.
You could also save the date token to the clipboard and manipulate that before pasting it.
-Chris
2 Likes
okn
January 6, 2023, 10:42pm
3
Here is my very simple but not working macro:
Insert Date Time into you frontmost app.kmmacros (3.9 KB)
1 Like
okn
January 6, 2023, 10:49pm
4
This is even simpler, but it works!
Thank you.
/
with best regards, Omar KN, Sweden
1 Like