I want to create a button in ArcCatalog that takes the metadata from the selected file in ArcCatalog and prints it to a text file. The metadata extraction part is done, and I have succssfully tested it on a number of GIS datasets. However, I cannot figure out how to get information about the currently selected item in ArcCatalog.

Is this possible in ArcCatalog? I expected for there to be something simple, and similar to the Arcpy.mapping.MapDocument("CURRENT"), but I can't find anything.

I would prefer to keep this in python, but an ArcObjects solution is also possible (just not preferable)

  • 2
    Any reason you don't just use the export button in the items description tab, just curious? – landocalrissian Dec 19 '14 at 20:06
  • 1
    What version of ArcGIS? The pythonaddins module, as of 10.3, has a function to fetch the currently selected Catalog Window's path. – Jason Scheirer Dec 19 '14 at 20:43
  • We are using 10.2 at my office, so that is good to know. The current tool for 10.2 looks like it is close, but yeah, it doesn't seem to work with ArcCatalog – Benjamin Stewart Dec 19 '14 at 20:44
  • The export function would work, perhaps, but based on the workflow we want, it is a bit more work than necessary. I might consider it though – Benjamin Stewart Dec 23 '14 at 19:17

An alternative would be to deploy your script in a toolbox, which you could access from ArcCatalog. The script, which you expose as a tool in a custom-made toolbox will allow your users to select a datatset and run the script on it. Should you need to run the script on several datatset , you users can use the built-in batch mode (present by default in all tools).

  • That's a good suggestion, thanks! Its not the exact workflow we want, but it could be an easy interim solution – Benjamin Stewart Dec 23 '14 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.