robm80 wrote:
1. Why the doFind script needs line 4: " if the result <> "" or the shiftkey is down then exit repeat"
Without this line the scipt does not work.
The repeat loop has no exit condition, it will loop forever, so there needs to be a way to tell it when to stop. When no more instances are found, the result is set to "not found". Otherwise the result is empty (meaning a match was found.) So we stop when the result isn't empty. The shift key is something I put in to give you a way to abort prematurely if you wanted to stop the search manually.
2. The boxes are drawn everywhere needed, but removing them is a new problem"
put field "comment" into field "comment" does not remove the boxes, but underlines the whole text of fld "comment"
Fields can have a default style, which is applied to all the text it contains. The characters in a field can have their own style too, which you apply by selecting them with the mouse. When the script removes the character styles (the boxes) the text will default to the field style. I assumed that was plain but you must have set it at some point. Open the field's property inspector and in the Text pane, unselect underlined. Set the field's default style to plain (the "P".) Then the script will work.
3. All objects of the cards were set to background behavour, so they were grouped.
Now I want to ungroup them, but nope; there is no group anymore: each object can be selected.
I needed the ungrouping to write an opencardscript for (when it removes the boxes) "put field "comment" into field "comment".
Don't ungroup the objects. If you do that now, you will lose the text from all fields. You are using a shared group with different text on each card. Ungrouping will wipe out all that.
You don't need to ungroup anyway, and in fact the current setup is the correct one. You can get to the group script in any number of ways:
1. Open the application browser from the Tools menu. Click your stack on the left, then any card that has that group on it. Find the group in the right-side pane and right-click to edit the script.
2. Open the project browser from the Tools menu. Expand the objects until you see the group. Right-click it to edit the script.
3. Click "Select Grouped" in the Toolbar at the top of the screen. That toggles whether you are able to select groups, or the objects inside the group. You've probably turned this off, which is why you think you can't select groups any more. Once you can select the group, right-click to edit the script.
4. Type in the message box: edit script of group "whatever"
Any of those methods will get you to the group script.
Do I have to recreate the whole application?
You'll never need to recreate the stack. Anything you get yourself into, you can get yourself out of. The main problem is that you're still not sure what does what, so it's easy to get lost. Keep hammering at it, it will all fall into place pretty soon.
If you haven't yet read the User Guide (in the Help menu) you'll find out all sorts of things. All the behaviors we've been talking about are in there. You don't have to read it all at once, just look at the things you're learning at any given time. Also, the dictionary will be your constant companion. For starters, see what it says about "find".