0

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

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.