|
Swyft Newbie
Joined: 04 Apr 2009 Posts: 4
|
Posted: Wed Apr 08, 2009 5:04 am
#CW Question |
I would like to create an alias that colors whatever keywords I specify. Right now, I'm starting with:
#alias {mark} {#CW %params orange}
Every time I "mark" a word, a separate trigger gets created. Is there a way to specify the destination of the trigger that gets created, so that if I've marked 20-30 words, I can go back and simply #DELCLASS {marked} and delete all the markers I've made? As opposed to opening up the package editor and deleting each #CW trigger one by one? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Wed Apr 08, 2009 5:15 am |
#CW is just like an alias shortcut to #TRIGGER, which is the only reason using %selected get evaluated... I cant think of a way to do this via strait trigger creation...
But might i suggest running it off a variable instead?
#ALIAS mark {#ADDITEM orange %selected}
#TR {{@orange}} {#CW orange} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Wed Apr 08, 2009 5:58 am |
hmm
Code: |
#class Collective
#var tm_catchall %replace(%params," ","|")
#forall @tm_catchall {#cw %i Red}
#unvar tm_catchall
#class 0 |
Would make color word red for it's parameters in a folder named Collective. You could name the alias Mark. if you accidently double space params funky chickens might appear on the full moon
Code: |
%replace(%params, " ", "|") |
too? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Wed Apr 08, 2009 6:09 am |
ah yes... #CLASS would work around it, good call.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Swyft Newbie
Joined: 04 Apr 2009 Posts: 4
|
Posted: Wed Apr 08, 2009 6:29 am |
Ty for the help, but honestly I have no idea what is going on -
I tried shalimar's solution and it wouldn't even color anything.
Ex: I want to color the word test, so i do mark test
Instead of getting it colored, I have a variable named orange with entries mark and test
I tried Leitia's code and still can't figure out what is supposed to happen =(
If you don't mind, please explain what I'm supposed to do with it |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Wed Apr 08, 2009 7:43 am |
#ALIAS mark {#ADDITEM orange %params}
//old version used %selected instead of %params, my bad
#TR {{@orange}} {#CW orange}
unless you use my trigger as well (which colors every instance of the words contained in the variable), that's all it was supposed to do, populate the variable for the trigger to use. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Swyft Newbie
Joined: 04 Apr 2009 Posts: 4
|
Posted: Wed Apr 08, 2009 8:26 am |
Ah thank you so much, this is a great alternative solution!
|
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Wed Apr 08, 2009 1:05 pm |
I wrote "an alias that colors whatever keywords I specify" I am curious what it was you did try because you should have "whatever keyword" in a folder named Collective that you "can go back and simply #DELCLASS" I did not name the folder Marked, not thinking (it was late) that was a folder name.
MARK test1 test2 test3
makes the words test1, test2, and test3 red, that is when you have those words displayed |
|
|
|
|
|