Hello! I have created a Python File that automatically runs a update of the current map the user is looking at to the AGOL. However, I would like to add this as a button in their custom ribbons so they dont have to run a seperate file each time. Does anyone know how to do this? Below is the path of the py file I am hoping to run.
C:\GIS\Scripts\update_maps_fast.py
There might be a way to hack a specific tool into a ribbon button, but odds are you'll have to bundle your toolbox into a Pro Addon using the SDK Documentation.
Python buttons were dropped in the upgrade from ArcMap to ArcPro so as far as I know this is indeed the only way. You have to define the ribbon/tool using C# and a daml file then call the Python tool using the C# SDK.
It would be nice to have Python buttons back, since a lot of the time you don't need the baggage of the SDK to get what you need done and managing compiled extensions can be a pain.
You can format your script to use the .pyt interface and import it as a Toolbox if you want. I do that for most of my scripts since I'm too lazy to maintain C# extensions lol.
If you don't have any parameters, you can usually just copy and paste most of your script into the execute method.