ZBrushCentral

ZScript: Import Alpha from Clipboard

Hi I’m trying to create a simple Zscript that imports an alpha using my clipboard which has the full explorer path to the alpha on my drive.

When I do this, the macro looks like this:

//ZBRUSH MACRO - Recorded in ZBrush version 2023
[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[IShowActions,0]
[IConfig,2023]
[FileNameSetNext,“D:\MENDLER Dropbox\Matthew Endler\02 ASSETS_GRAPHICS_TEXTURES\12 FURNISHINGS\PAPER\pnorm_Paper_CrumpledPackingPaper01_SNX030114\pnorm_Paper_CrumpledPackingPaper01_SNX030114.psd”][IPress,Alpha:Import]
]

Unfortunately, this doesn’t work, because it actually hardcodes the selected alpha filename into the script. Whatever is in the clipboard should be different every time.

Ideally, it looks like this (Where CTRL+I is my hotkey for importing alphas):

//ZBRUSH MACRO - Recorded in ZBrush version 2023
[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[IShowActions,0]
[IConfig,2023]
[IKeyPress, CTRL+‘i’]
[IKeyPress, CTRL+‘v’]
[IKeyPress, ‘ENTER’]
]

However, Zbrush doesn’t recognize the command for ENTER. What is the best way to accomplish this?

The easier option would be to use the command StrAsk to copy and paste your path in the StrAsk input box and use the text you entered to load your alpha.

It’s possible to access the system clipboard but you will need an executable or a dll for that, and call it from a script.