TakeScreenshot() is the function you are looking for to capture the screen. To use in a macro, use:
|
Source code
|
1
|
/run TakeScreenshot()
|
Edit: BTW, if you want to hide the user interface before taking a pic, you can use
|
Source code
|
1
|
/run UIParent:Hide()
|
To restore the screen, use
|
Source code
|
1
|
/run UIParent:Show()
|
You would of course want both in the same macro or you'd be stuck with a hidden UI though you can always use Alt+Z (or something like that) to restore the screen.
Edit 2:
Also forgot to mention, if you want to take multiple screenshots within the same macro, make sure to wait for at least one second between shots or the next screenshot may overwrite the previous one. The game uses the current data and time for the filename, so waiting one second (via
/wait 1) will guarantee differing filenames.