Hi,
I'm
using TW on multiple computers with different screen sizes and what I'm
trying to do is maximise the browser window on startup IF the current
screen width ($:/info/browser/screen/width) matches 1366 pixels
(laptop).
I've created a tiddler named StartUp and tagged it with $:/tags/StartupAction/Browser
In the tiddler's text area, I've typed in the following code (the dependency here is Evan Balster's formula macro):
\define BlaBla()
<$set name=screen_width value={{$:/info/browser/screen/width}}>
<<Conditionals>>
</$set>
\end
\define Conditionals()
<$formula formula="if(($(screen_width)$=1366), '<<MaximiseBrowserWindow>>', '')"/>
\end
\define MaximiseBrowserWindow()
<$action-sendmessage $message="tm-full-screen"/>
\end
<<BlaBla>>
Unfortunately this does nothing.
For testing purposes, I've removed most of the above code and left out just the action line:
<$action-sendmessage $message="tm-full-screen"/>
This does nothing either.
I
know it is strange just to place actions in tiddlers on their own but I
would have assumed that the trigger here is startup itself and the code
should be executed just because the tiddler is tagged as it should, as
if the whole snippet was a button action (?)
Is there anything I'm missing here or is it just that, by design, actions cannot be executed conditionally?
Thank you for your input.