Weird Problem
Weird Problem
- Subject: Weird Problem
- From: Dave <email@hidden>
- Date: Wed, 04 Nov 2015 09:12:12 +0000
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