0

I'm trying to build an if statement in AppleScriptObjC that checks whether the title of a window matches a certain string, but I'm not sure of the correct syntax.

For example:

theWindow's setTitle_("testing")

if theWindow's title = "testing" then
  do some stuff
else
  do some other stuff
end if

That's obviously not the correct syntax but hopefully it demonstrates what I'm after. Thanks for your help!

1 Answers1

1

A friend of mine resolved this:

theWindow's setTitle_("testing")

set testTitle to theWindow's |title|() as string 

if testTitle = "Testing" then 
  do some stuff 
else 
  do some other stuff 
end if