Stickies
« multi-line text via apicmd »

Welcome Guest. Please Login or Register.
Apr 25th, 2017, 09:40am


Click to go to the
Zhorn Software Web Site
Click to go to the
Knowledgebase

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: multi-line text via apicmd  (Read 179 times)
TheAncient
New Member
Image


member is offline

Avatar




PM


Posts: 14
xx multi-line text via apicmd
« Thread started on: Dec 17th, 2016, 8:37pm »

Hi there,
Is it possible to use APIcmd.exe to set multi-line text? I.e. rather than
apicmd.exe "set desktop <ID> text One single line of text" > nul
I would like something equivalent to
apicmd.exe "set desktop <ID> text First line of text <CLF?> Second line of text" > nul
huh
User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3528
xx Re: multi-line text via apicmd
« Reply #1 on: Dec 19th, 2016, 2:06pm »

Unhelpfully, not.

You can do this if you set RTF content, but that does need a whole extra level of encoding which you may not want to have to do.

Tom
User IP Logged

TheAncient
New Member
Image


member is offline

Avatar




PM


Posts: 14
xx Re: multi-line text via apicmd
« Reply #2 on: Dec 19th, 2016, 2:36pm »

Thanks Tom! I guess I am pushing the boundaries just a bit too far.
One other question: I am trying to create a Sticky with centered text (again via apicmd) but, while I can specify all kinds of font characteristics in a style and then apply that style to my newly created sticky, I have not found a way to specify paragraph characteristics such as centered text. Is there a way to accomplish that?
User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3528
xx Re: multi-line text via apicmd
« Reply #3 on: Dec 20th, 2016, 6:11pm »

Ach, again that's achievable with RTF.

You know, it might not be that much extra work. This is valid RTF:

{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang2057{\fonttbl{\f0\fswiss\fprq2\fcharset0 Segoe UI;}}
{\colortbl ;\red0\green0\blue0;}
\viewkind4\uc1
\pard\qc\cf1\f0\fs24 hello\par
there\par
from\par
Tom\par
}


It's centered, and on different lines, you can see the text "hello there from Tom" inside the code - and so converting from what you want to put into a note to this might just be a case of wrapping the above around the text, and replacing newline characters with \par?

Tom
User IP Logged

TheAncient
New Member
Image


member is offline

Avatar




PM


Posts: 14
xx Re: multi-line text via apicmd
« Reply #4 on: Dec 21st, 2016, 1:00pm »

Hi Tom,
I'm afraid you lost me somewhere along the way:
Currently I have a batch (.bat) file that issues the command
apicmd.exe "set desktop <Sticky_name> text %Sticky_Text%" > nul

How do I use that block of code you posted in my batch file?
I would probably have to
Find the rtf file that corresponds to the sticky - something like C:\Users\<user>\AppData\Roaming\stickies\rtf\<Sticky.rtf>
Open that rtf with "something?" (some sort of editor, I guess)
and then "feed" your block of code to that editor.
Unfortunately I have no clue how to do that.
User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3528
xx Re: multi-line text via apicmd
« Reply #5 on: Dec 22nd, 2016, 2:48pm »

Try this:


set desktop <id> rtf {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang2057{\fonttbl{\f0\fswiss\fprq2\fcharset0 Segoe UI;}}{\colortbl ;\red0\green0\blue0;}\viewkind4\uc1 \pard\qc\cf1\f0\fs24 hello\par there\par Ancient!\par}


Tom
User IP Logged

TheAncient
New Member
Image


member is offline

Avatar




PM


Posts: 14
xx Re: multi-line text via apicmd
« Reply #6 on: Dec 22nd, 2016, 3:36pm »

Worked like a charm!
(of course, I had to add apicmd.exe and enclose the string in quotes i.e.
apicmd.exe "set desktop <id> rtf {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang2057{\fonttbl{\f0\fswiss\fprq2\fcharset0 Segoe UI;}}{\colortbl ;\red0\green0\blue0;}\viewkind4\uc1 \pard\qc\cf1\f0\fs24 hello\par there\par Ancient!\par}")
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls