Weird problem with a script?
Weird problem with a script?
- Subject: Weird problem with a script?
- From: Dave <email@hidden>
- Date: Fri, 11 Mar 2016 16:31:05 +0000
Hi All,
Can anyone tell what’s wrong with this code snippet?
If “if” statement is ALWAYS failing, see log output.
I’m reading the Value in myCustomValue from a MS Word Custom Document Property if that makes any difference? I return it as a string, as in:
return myValue as string if the getWordCustomDocumentPropertyWithDocumentID handler.
------------------------
set myCustomValue to my getWordCustomDocumentPropertyWithDocumentID:(myDocumentID) andPropertyName:(myCustomPropertyName)
--set myCustomInitialValue to myCustomValue
copy myCustomValue to myCustomInitialValue
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 & "<<<<<“
Log Output:
(*>>>>> myCustomValue: HIGH<<<<<*)
(*>>>>> myCustomInitialValue: HIGH<<<<<*)
(*Setting myCustomValue to HIGH*)
(*>>>>> myCustomValue: HIGH<<<<<*)
(*>>>>> myCustomInitialValue: HIGH<<<<<*)
tell application "Script Editor"
display dialog "STOP"
Result:
error "User canceled." number -128
All the Best
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden