Re: Weird Problem
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