Browsing to file location using script
Is it possible to perform the equivalent of the Content Library's Browse to File Location, opening an OS file window, via script? I have found a browseToAsset(DzAssetPtr) function in the Content Library pane object, but I can't see how to get an asset pointer from a file (ideally direct from a string with the relative path name, or the absolute path name obtained from DzContentMgr, though using a DzFile or FileInfo would be fine). As I am intending to use this, the Content Library would definitely not be showing the asset I wanted to browse to though I think it might be possible to switch to showing the asset in question - but the function also seems to need input other than a straight string or DzFile - and then go back to the original location.
Comments
The context is different (i.e. single file vs multiple files) and this simplifies dealing with database records, but here is a DAZ Script that roughly does what the "Browse to file location..." action in the Content Library context menu does:
-Rob
Ah, thank you - I thought there should be something in App but I wasn't finding it. That's much simpler than going through the content pane (I will be starting with the relative path available, so I just need to turn it absolute and use the show* function). Thanks Rob.
When I use this code I get this error :
Script Error: Line 8
TypeError: Result of expression 'oAsset.getAsLocalFile' [undefined] is not a function.
Stack Trace: ()@:8
That's useful - the conversion from the old forum has stripped out the array index [ i ] as well as the carriage returns. The script should be:
Ahh thanks !