Create a macro to generate a print variable?

Hi! 

I'm wondering if it is possible to create a macro that generates a specific print for a variable, e.g. if you select a variable stuffs, it then generates a print("stuffs -> ", stuffs). Or similar. Have tried to explore the macros, but it repeats exactly the same thing... Does anyone know how to do this? 

Thanks!

2 comments
Comment actions Permalink

That's awesome! Thanks. Almost managed to do what I wanted! Do you know if there is any way allow it to leave the line with the selected variable alone and add code below? 

E.g.

stuffs = ....

select stuffs -> ctrl + alt + T -> template, which produces

stuffs = ....

print("stuffs...

0

Please sign in to leave a comment.