I've noticed that when you export a layout to PDF in Pro, it gives you a handy option to "View exported file." Is there a way to add this prompt for a file generated from a Python toolbox?
Solved! Go to Solution.
You could set a boolean parameter named 'View exported file' in your tool, and then at the end of your script you set a conditional that checks if the boolean is true or false and do an os.startfile('exported path') if its true.
they aren't part of a tools parameeters
Layout—ArcGIS Pro | Documentation
exportToPNG (out_png, {resolution}, {color_mode}, {transparent_background}, {embed_color_profile}, {clip_to_elements})
I've tried adding links via AddMessage and SetProgressorLabel, but the resulting link isn't a "live" hyperlink, whether to a URL or a file.
Getting a "completion" message to show up is probably something that would need to be done via the Pro SDK, rather than from a Python script. It would be a really great feature, though!
You could set a boolean parameter named 'View exported file' in your tool, and then at the end of your script you set a conditional that checks if the boolean is true or false and do an os.startfile('exported path') if its true.
Yikes! My bad on that one- thanks for catching it. I had C#'s File.Open stuck on the brain for opening files.
I updated the post with your correction.