I've written an exporter plugin (not save-as) that exports a given file to a custom format.
I was able to open a file selector dialog and choose a path that is then transported to the saving location.
Now my problem is: Another intended use is batch exporting many files. The user records an action with the export step and then applies a batch on it.
The PS batch window allows you to select the destination to be a directory where the exporter should write the data. Fine.
Now how do I get this path? When running in batch mode the silent flag is set for my plugin so I do not spawn a file selector dialog to annoy the user.
But I am also unable to obtain the path which was selected by the user in the batch window.
The SDK automation plugin
Getter has some code to retrieve the path of the file and even that fails as it cannot obtain anything.
PropertyUtils.h has some
PIGetPathName functions but I always get 0 when asking
PIGetNumberPaths, and get -1 with
I would be thankful if somebody could hint me how I can retrieve directories.
It even seems impossible for me to get the path where the file is actually saved. The filter plugin called Propertizer utilizes a function called
PIGetDocumentName but this only outputs the file name, not the full path.
(Just to be sure: The file on which the tests run is already saved to disk, if that matters)
Another fun part is: When I record an export step, what is the directory I am exporting into?
Ok, after lots of reading the sdk sample outbound I've realized that or plugin is broken.
When recording an action the outbound plugin stores the current path to gAliasHandle which is then recorded as a scripting parameter. Now when I execute the action I get the alias handle.
However how is this supposed to work with an export plugin and batch processing with a "destination" set to a target? Is this even possible or do I need to double click the export step in the action and "reset" the location even if that causes the entire exporter to run again?