Large text display time based on variable?

I understand that you can alter the display duration of the ‘large display’ by altering a pref file.
Would it be possible to set the ‘large display’ of text duration to a variable?

I get a macro to change the 'Display text large' duration when I use text in the execute shell script step. It writes the preference file.

But it doesn't work when using a variable that contains that same text (I used 5.0 instead of 1.0 for duration. Am I not able to use a variable in the 'execute text script' step?

I don’t think that the Shell Script action expands variables of the type “%Variable%”.

This will work:

[test] Change Large Display Duration Pref.kmmacros (2.2 KB)

BTW: Would be nice to upload the macro, so that we don’t have to re-type everything from the screenshot :wink:

###Edit/PS:

Or, if you prefer to put the whole command line into a variable:

[test] Change Large Display Duration Pref (Entire string).kmmacros (2.5 KB)

1 Like

Beautiful!, the $KMVAR_ is perfect. Thank you.
Sorry about not uploading the macro for ease, will note to do next time.
Cheers~

Is there a way to get the currently set duration time?

I can get it by looking at the pref file, but would like to automate it in KM if possible.

Thank you

Instead of using defaults write com... to set the duration, use defaults read com... to get it:

image

Note that the action will error if you haven't previously set that "hidden preference", so you might want to put it in a "Try/Catch" block.

2 Likes