You have described what your script is intended to do. Now let's see the actual script.
I do not know how to insert images, so here is the script;
I found a simpler script iwth the use of Insert Text. Here is the script;
Insert Text[Select;California Sea Life DB::Test2;"Yes"]
With Select Entire Content and Go To Target Field both checked.
What's the expression you use for your conditional format?
If you temprorarily remove the conditional formatting so that the text in the field is readable, do you see the text you expect?
I'd use set field instead of Insert Text, by the way. Though what you describe should work OK, the "insert" script steps only work if the field is present on the layout and you don't have to place the field you set to "yes" anywhere on the layout if you use Set Field instead.
1. It's Fitch.
2. Test2 is neither Show nor Name. It's tough to diagnose the problem if the description doesn't match the example.
3. You've experimented with Copy/Paste and Insert Text, but a more reliable method is Set Field. This script step does not require that the field even be on the layout.
4. I don't see the point of the global field if you're always going to set the show/test field to "yes." It makes more sense to set it to a fixed value as in your last post.
It seems to me the only issue is whether the field targeted in your script matches the field in your conditional formatting formula.
OK, what I did was abandon the global field and cut paste idea when I discovered the Insert Text Script. Now I have created a field called Insert Text Field.
I then created a script called Insert Yes which is an Insert Text script. So here is what this simple script is;
Insert Text[Select;California Sea Life DB::Insert Text Field;"Yes"]
Select Entire Content is checked and Go to Target Field is checked. The Specify Field is Insert Text Field. The Specify is Yes.
I then created a button that will Perform Script. The script to perform is the Insert Yes scrtipt described above.
So at this point, the button works fine. When pushed, the word Yes appears in the Insert Text Field.
So now I go and creat a Conditional Formating for Name. "Name" is a text field of the California Sea Life that I am working with.
The Condition is [ Formula is California Sea Life DB::Insert Text Field = "Yes" ] Format is Fill Color
Fill Color is checked and the fill color white box is selected.
So the ideas is that when I push the button, it will paste Yes into the Insert Text Field and then this will trigger the Conditional Formating to turn the color of the Name field from the std black to now white so that the black text will appear.
But what actually happens is that when I push the button, nothing happes to the Insert Text Field but Yes replaces the name of the fish in the Name field and nothing happens with the color of the Name field. If I manually type Yes into the Insert Text Field, the Name field then changes to White per the Conditional Format.
So what the heck could be happening?
You might try adding a Commit script step after inserting the text.
(As Phil and I have suggested, Set Field is generally best practice unless you have a specific reason to use Insert Text.)
Now, you first say that when you click the button, the word Yes appears in the IT field.
But then you say after you set up conditional formatting, the script no longer sets the IT field. That cannot be a cause and effect, there's something else going on here that we don't know about.
If you want to send a copy to <firstname.lastname@example.org> I'll have a look at it.
Well, that was perplexing. Jeff, in the file you sent, it was behaving as you described after all: the field specified as the target in Insert Text was not getting the text, it was inserting the text into another field. Very strange.
I experimented with the script a bit, and then finally I went and changed some of the layout options. Then it started working! To verify, I downloaded the file again; went straight to layout options; changed nothing!; clicked OK; script works! Very, very strange. Makes me wonder if there could be file corruption.
At any rate, listen: don't use Insert Text. Use Set Field. A big advantage is that the field you're setting (the Yes field) doesn't even have to be on the layout. You will still probably want to add a Commit step at the end.
I've had a couple of cases, either personally or when helping someone here where a given layout stopped putting the cursor where a script or layout setting (ie. tab order) specified it should go. Each case traced back to a corrupted layout. I've had pretty could success with just replacing the layout instead of replacing the entire field when this happens.
Definitely wouldn't hurt to run a recover on the file and see if any problems are found just to be on the safe side. Best practice is to replace a damaged file with an undamaged copy instead of using a recovered copy if it is at all possible to do so.