Hello Dave
May you add one instruction just after the instruction : set myCustomValue to my getWordCustomDocumentPropertyWithDocumentID:(myDocumentID) andPropertyName:(myCustomPropertyName)
log (get class of myCustomValue)
I'm wondering if you are in fact returning a list containing one string.
I built a fake version of your script and, it behaves exactly as yours.
set myCustomValue to my getWordCustomDocumentPropertyWithDocumentID()
--set myCustomInitialValue to myCustomValue copy myCustomValue to myCustomInitialValue log (get class of myCustomValue) # ADDED log myCustomValue # ADDED log ">>>>> myCustomValue: " & myCustomValue & "<<<<<" log ">>>>> myCustomInitialValue: " & myCustomInitialValue & "<<<<<"
if myCustomValue is equal to "HIGH" then -- I’ve tried using “=“ instead of “is equal to” and both always fail? log "Setting myCustomValue to LOW" set myCustomValue to "LOW" else log "Setting myCustomValue to HIGH" set myCustomValue to "HIGH" end if
log ">>>>> myCustomValue: " & myCustomValue & "<<<<<" log ">>>>> myCustomInitialValue: " & myCustomInitialValue & "<<<<<"
on getWordCustomDocumentPropertyWithDocumentID() return {"HIGH"} end getWordCustomDocumentPropertyWithDocumentID
The events log was : (*list*) (*HIGH*) (*>>>>> myCustomValue: HIGH<<<<<*) (*>>>>> myCustomInitialValue: HIGH<<<<<*) (*Setting myCustomValue to HIGH*) (*>>>>> myCustomValue: HIGH<<<<<*) (*>>>>> myCustomInitialValue: HIGH<<<<<*) If I am right, you just have to add one of these instructions :
set myCustomValue to myCustomValue as text set myCustomValue to item 1 of myCustomValue
Yvan KOENIG running El Capitan 10.11.3 in French (VALLAURIS, France) vendredi 11 mars 2016 17:59:07
|