Accessing z-stack number

Is there a way to access the z-stack number for use in data export and file saving? I can use sequential numbers for file saving file names, but not at the same time as metadata.

Never mind - I just figured out you can use:
\g
Undocumented feature!