Tinderbox Forum

Can I search for strings in Action Codes?


(Ralph Alvy) #1

Can I search for all instances of a string in all Action Codes that exist in a document? Say I rename a User Attribute and then want to see where I reference that old User Attribute in Action Codes here and there, so I can replace those instances with the new name. Is there a way to do that? I assume renaming a User Attribute will not result in that change cascading through Actions Codes.


(Mark Anderson) #2

Such changes now, as of v7.x(?), cascade though to $KeyAttributes but not into stored action code.

There is no single query to find all action code. It can be in a variety of places, not all accessible via a Find or using an agent. Most easily found are the 13 Action data-type system attributes. Stamp code can be viewed via the Stamps Inspector. As of v8, each link type can have an action (seen via the Action Inspector).

Other places you might have stored action code:

  • Templates, e.g. in ^action()^ or value()^ calls.
  • In code notes.

As regards code in attributes, this is a where prototypes pay of - you edit only one instance of a rule, edict, etc., but fix many notes’ code.


(Ralph Alvy) #3

Thanks, Mark. What I ended up doing is loading a copy of the TB XML file in BBEdit and searched for all instances of a particular old Attribute and located where such instances were. I then renamed them using TB itself. It was tempting do just do a Find And Replace on the XML file with BBEdit, but there were so few instances, I didn’t take a chance on an unsupported action.


(Mark Anderson) #4

Good, glad you are fixed. This reminds me I probably ought to add something to aTbRef on this topic. It’s rather arcane, but if you need to know all the places attribute names might be stored … you need to know!


(Ralph Alvy) #5

You might want to update this as well:
http://www.acrobatfaq.com/atbref7/index/Attributes/Renaminganattribute.html


(Mark Anderson) #6

Good point. I think that page is up to date and the first two paragraphs cover the issue here (with the exceptions of the new-to-v8 link type actions. However I think I can make the list of code locations more explicit.