• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Weird problem with a script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird problem with a script?


  • Subject: Re: Weird problem with a script?
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 11 Mar 2016 17:59:20 +0100


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



 _______________________________________________
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

References: 
 >Weird problem with a script? (From: Dave <email@hidden>)

  • Prev by Date: Weird problem with a script?
  • Next by Date: Re: Weird problem with a script?
  • Previous by thread: Weird problem with a script?
  • Next by thread: Re: Weird problem with a script?
  • Index(es):
    • Date
    • Thread