Creating Custom action script in folder

I used one of the examples "http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/actions/action_custom_create/start"; and I tried switching from using the DAZ application path to use the DAZ libairy folder, and for no reason, it's not adding the script to the menu. I'm trying to add another script in a subfolder. Are subfolders not supported?

Here's the code.

//Set what folder this particular script is coming from	var sPath = DzFileInfo(getScriptFileName()).path();		// Define the custom action componentsvar sActionMenu = "Fa&vorites";var sActionToolbar = "Fa&vorites";var sActionText = "Lock Feet (G1)";var sActionDesc = "Lock Feet (G1)";var sActionFilePath = sPath + String( "//Actions/Lock Feet G1.dse" );var sActionIconPath = sPath + String( "//Actions/Lock Feet G1.png" );var sActionName = createCustomAction( sActionText, sActionDesc, sActionFilePath, sActionIconPath, true );addActionToMenu( sActionMenu, sActionName, true, -1 );

 

Comments

  • Rob noticed one immediate issue, your DzFileInfo isn't being properly created -

    var sPath = (new DzFileInfo(getScriptFileName())).path();	

    though he also points out that this is dangerous as you are assuming that the File Info object is successfully created - you shoudl split this so that you can verify that you have a valid object before getting its path().

Sign In or Register to comment.