Dark star
Dark star

Reputation: 5832

Apple Script get result value from block of code

I have a block of code that returns the current value of input language

tell process "SystemUIServer" to 
   get the value of the first menu bar item of menu bar 1 
   whose description is "text input"
tell end

Now I want to check the result with IF Else but I don't know how I should do it!

Thanks

Upvotes: 0

Views: 179

Answers (1)

vadian
vadian

Reputation: 285064

First of all you have to tell System Events to do the job.

Just assign the result to a variable

activate application "SystemUIServer"
tell application "System Events"
    tell process "SystemUIServer"
        set textInput to (get value of the first menu bar item of menu bar 1 whose description is "text input")
    end tell
end tell

Upvotes: 1

Related Questions