Variables in Macros?

  • Hi,

    i want to have a macro line which creates and stores a uservar and then want to use that in another macro.

    So macro A is: setuservar „thisthing“ „image 3.101 thru 3.113“

    Macro B is: copy $thisthing at Image 3.201

    Commandline feedback from macro B though is only: Copy at image 3.201

    When I just try to find my variable it doesn’t show either. Why is this? Can I not set a variable using a macro? The variable works fine if I set it myself and then run macro B, but not through Macro A.

    I‘m on version

    Any help appreciated!

    Stay Bright!


  • Just to be sure, you are using double upper quotes on both sides like "this"? So macro A should be:

    setuservar "thisthing" "STRING OF TEXT"

    I think your problem here is, is that you are trying to use a string of text as a numerical value. Variables can have either text (with quotes) or numbers (without quotes) stored into them, but not both at the same time. Also numbers can only be whole numbers without a '.' So when you are trying to run macro B it will try to copy 'string of text' at image 3.201. MA does not know what that string of text is... (you can use text for labeling for example; label image 3.101 $textvar)

    What you want to do is set up two variables:

    Code: Macro A
    setuservar "value1" 101
    setuservar "value2" 113
    Code: Macro B
    copy Image 3.$value1 thru 3.$value2 at Image 3.201

    Hope that helps :)

  • Hi! That definitely works! Thanks for replying quickly. I was hoping I could have one variable which has a range of values all by itself but I guess not...

    Also yes my quote marks are right, just a stupid German keyboard ;)

    Thanks again, good luck to you!

    Stay Bright!


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!