It's working now. I ran a couple of jobs overnight (first clear night in a long time!), and in the morning while I was transferring images, I started experimenting with the indi_getprop and indi_setprop on the command line. I don't know if that cleared out some buffer or initialized something, but it's working now. The script execution is reported in the status and the path stays in the Scripts Manager. The Pre-Capture script works for Previews, too. (In the case below, the script actually fails because I wasn't running the Simulators, but you can see the error in the status) Thanks for your help, Jasem!
Here's the script I put together to check if the Flip Flap is open, close it if it is, and wait for it to report closed. I also have the companion to open it if it's closed.
BTW, a side note about the Flip Flat: Don't use it to generate flats immediately after a set of lights during a job if you have an OAG. Don't ask why I know this...
#!/bin/bash
#Shell script to close/park the Flip Flat if the cap is open
#AirBourn 2022
debug=false
coverProp="Flip Flat.Status.Cover"
motorProp="Flip Flat.Status.Motor"
#Delineator
IFS='='
coverStatus=$(indi_getprop "$coverProp")
read -ra cArr <<< "$coverStatus"
coverString=${cArr[1]}
if $debug; then echo " cStatus: ${coverStatus}"; fi
if $debug; then echo " cString: ${coverString}"; fi
motorStatus=$(indi_getprop "$motorProp")
read -ra mArr <<< "$motorStatus"
motorString=${mArr[1]}
if $debug; then echo " mStatus: ${motorStatus}"; fi
if $debug; then echo " mString: ${motorString}"; fi
if [[ "$coverString" == "Open" ]]
then
if $debug; then echo " Sending Close Command"; fi
indi_setprop "Flip Flat.CAP_PARK.PARK=On"
indi_setprop "Flip Flat.CAP_PARK.UNPARK=Off"
while [ $coverString != "Closed" ]
do
coverStatus=$(/usr/bin/indi_getprop "$coverProp")
#echo "Cover: ${coverStatus}"
read -ra cArr <<< "$coverStatus"
coverString=${cArr[1]}
if $debug; then echo " Cover: ${coverString}"; fi
motorStatus=$(/usr/bin/indi_getprop "$motorProp")
#echo "Motor: ${motorStatus}"
read -ra mArr <<< "$motorStatus"
motorString=${mArr[1]}
if $debug; then echo " Motor: ${motorString}"; fi
done
fi
if $debug; then echo " Cover is ${coverString}"; fi
exit 0