How to check if a specific macroscript available

Hello,
I hope you guys are well.
I need help checking if a specific macroscript is available before crashes happen.

when I run this,

macros.run "Poliigon" "PoliigonMaterialConverter"

Its shows this in listener,

-- Error occurred in anonymous codeblock; filename: ; position: 49; line: 1
-- Runtime error: No such macro-script: PoliigonMaterialConverter
-- MAXScript callstack:
--	thread data: threadID:4148
--	------------------------------------------------------
--	[stack level: 0]
--	In top-level

But what I want is to show a popup that this macroscript is not installed.

Thanks!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Janettjeff's picture

macroscript

If you're using 3ds Max, methods for checking macroscript availability involve the MAXScript Listener or functions like macroScriptExists.
https://vegaprint.co.uk/

miauu's picture

.

An ugly solution:

try(macros.run "Poliigon" "PoliigonMaterialConverter")catch(print "No such macro-script")
7man's picture

Many thanks to you. Bravo.

Many thanks to you. Bravo.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.