• 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
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird Problem


  • Subject: Re: Weird Problem
  • From: Dave <email@hidden>
  • Date: Thu, 05 Nov 2015 12:12:33 +0000

Ahhhhhh, would this work too:

		if myValue starts with "Fish" then

(or is it begins with “Fish”).

All the Best
Dave


> On 4 Nov 2015, at 09:12, Dave <email@hidden> wrote:
>
> Hi,
>
> Please see the Script below, for some very strange reason the:
>
> 		if myValue = "Fish" then
>
> isn’t working, so it always runs the else statement.
>
> Any ideas?
>
> All the Best
> Dave
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> on getWordStandardDocumentProperty(theDocument, thePropertyName)
> 	tell application id "com.microsoft.Word"
> 		set myValue to the value of (document properties of theDocument whose name is thePropertyName)
>
> 		return myValue
> 	end tell
> end getWordStandardDocumentProperty
>
>
>
> on setWordStandardDocumentProperty(theDocument, thePropertyName, thePropertyValue)
> 	tell application id "com.microsoft.Word"
> 		set the value of (document properties of theDocument whose name is thePropertyName) to thePropertyValue
> 	end tell
> end setWordStandardDocumentProperty
>
>
> on run
> 	tell application id "com.microsoft.Word"
> 		activate
>
> 		set myDocument to the document of the front window
>
> 		--
> 		--	Test Standard Document Properties
> 		--
> 		set myValue to my getWordStandardDocumentProperty(myDocument, "Keywords")
> 		if myValue = "Fish" then
> 			beep 1
> 			set myValue to "Chips"
> 		else
> 			set myValue to "Fish"
> 		end if
>
> 		my setWordStandardDocumentProperty(myDocument, "Keywords", myValue)
> 	end tell
>
> 	return myValue
> end run
> _______________________________________________
> 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


 _______________________________________________
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


  • Follow-Ups:
    • Re: Weird Problem
      • From: John Stewart <email@hidden>
References: 
 >Weird Problem (From: Dave <email@hidden>)

  • Prev by Date: Re: Calendar - the big hangover
  • Next by Date: Re: Weird Problem
  • Previous by thread: Weird Problem
  • Next by thread: Re: Weird Problem
  • Index(es):
    • Date
    • Thread