Re: Getting class-name: Error when converting to string
Re: Getting class-name: Error when converting to string
- Subject: Re: Getting class-name: Error when converting to string
- From: Shane Stanley <email@hidden>
- Date: Mon, 5 Jun 2017 21:02:55 +1000
I’ve a function that takes an object as parameter. To execute specific code based on the class-name, I’ve written this (example) script: - set windowClass to class of theWindow
if (windowClass is equal to "NSWindow") then display dialog "continue" end if
The problem is that it never reaches the dialog, because windowClass is not a string and furthermore not comparable, so I need to convert the variable to a string: - set windowClass to (class of theWindow) as string
if (windowClass is equal to "NSWindow") then display dialog "continue" end if
Try:
set windowClass to class of theWindow if (windowClass is current application's NSWindow) then display dialog "continue" end if
|
_______________________________________________
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