Author Topic: need help with a macro  (Read 1615 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
need help with a macro
« on: August 23, 2005, 12:03:56 PM »
can anybody help me with a macro. i want to create a macro that will get the current color. then set the color to yellow. then draw a breakline then reset the color to the previous value. i'm stuck on retreiving the current and restoring part.

(getvar cecolor)-color;yellow;breakline

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
fixed macro
« Reply #1 on: August 23, 2005, 12:11:35 PM »
(SETQ CC (GETVAR "CECOLOR")) -color;yellow;breakline;\\\(setvar "cecolor" cc);
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

PDJ

  • Guest
need help with a macro
« Reply #2 on: August 23, 2005, 12:20:36 PM »
Code: [Select]
(setq cl  (getvar "clayer")        ;current layer
            cc  (getvar "cecolor")       ;current color
            tln (cdr (assoc 8 el))       ;text layer name
            tc  (cdr (assoc 62 el))      ;text color
      )


Put your breakline command in here....

Code: [Select]
(if (/= cl tln)(command "LAYER" "S" cl ""))
           (if (/= cc tc)(command "COLOR" cc))
       ;else
(setq cl nil cc nil)
(setq tc nil tln nil)


and that's the rest of it.. Nice and clean exit as well..

ELOQUINTET

  • Guest
need help with a macro
« Reply #3 on: August 23, 2005, 12:28:28 PM »
CmdrDuh yours didn't switch the color back to the previous. i'll try your method pdj when i get a minute. thanks this will help in other situations too.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
need help with a macro
« Reply #4 on: August 23, 2005, 12:39:38 PM »
maybe it needs a ; after the last ).  It worked on my machine if I type it in. (2006 and cui, I didn't actually make the button)
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
need help with a macro
« Reply #5 on: August 23, 2005, 12:41:47 PM »
thats what it needed.  I added the ; and it worked
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

ELOQUINTET

  • Guest
need help with a macro
« Reply #6 on: August 23, 2005, 02:32:48 PM »
ah i see the problem i usually except the default so in my case it would look like this \\; not this \\\ thanks man

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
need help with a macro
« Reply #7 on: August 23, 2005, 02:33:57 PM »
No problem.  Not knowing, I put that extra slash in so you could choose
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)