General XMetaL Discussion
jrob61 July 8, 2015 at 4:59 pm
XMAX 9.0 FindJuly 8, 2015 at 4:59 pmParticipants 2Replies 3Last Activity 6 years, 11 months ago
Looking for tips/tricks for duplicating XMAX's Find dialog/Find .Execute as it worked in Author Essential 5.5.
(1) For example in Author Essential 5.5, if highlight text that contains processing instructions and then call the Find dialog, it will remove the pi's from displaying within the find combobox and then successfully finds the text with the pi's in the document; but XMAX find dialog and .Execute method does neither?
(2) For example in Author Essential 5.5, if highlight text that contains a less than (<) or greater than (>) character, the find dialog will properly display the entity as < or > within the find combobox and then successfully find the character; but XMAX displays the entity (< / >) and consequently does not find the text.
Thanks in advance.Derek Read July 8, 2015 at 5:38 pm
Reply to: XMAX 9.0 FindJuly 8, 2015 at 5:38 pm
XMAX doesn't include this dialog, so presumably the implementation you are working with doesn't take these things into account.
The API being used to populate the dialog you are using probably uses Selection.Text (or a similar API that returns the user's current selection as text) and puts that into a string. Most likely it is here that you would need to alter whatever code has been implemented in order to convert this entity into a character. There's a disconnect with these APIs because Selection.Text (and some others) provides the full markup since there's no way to predict what a developer needs to do with it. On the other hand, Find.Execute API works the same way as the Find dialog in XMetaL Author Essential (they share the same code in the background) and in that case it searches for what the user is seeing in their current view. This means that if your current view is Tags On or Normal view then you need to search for the actual characters (< and >) but if the current view is Plain Text then you will need to search for the entities to find them (unless you are actually looking for the angle brackets of an element in Plain Text in which case you would actually search for < and >). In most implementations what the user asks to search for isn't altered here, but in your case the starting text (sucked in by Selection.Text or similar API) should probably be modified depending on the view the user is working in.jrob61 July 9, 2015 at 1:50 pm
Reply to: XMAX 9.0 FindJuly 9, 2015 at 1:50 pm
Thanks for the insight and having successfully tackled the Text tab within the Find dialog, I now can't seem to get the Element tab to find or replace using the .Execute method in tags on or normal view? Does the Element tab find/replace use a method other than .Selection.Find.Execute?
- You must be logged in to reply to this topic.