Getting class-name: Error when converting to string
Getting class-name: Error when converting to string
- Subject: Getting class-name: Error when converting to string
- From: email@hidden
- Date: Sun, 28 May 2017 18:11:10 +0200
Hi there, I’m using AppleScriptObjC currently. 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
But instead of a working script, I get an error-message: 2017-05-28 15:13:06.457513+0200 application[23383:1824803] *** -[AppDelegate applicationWillFinishLaunching:]: Can’t make «class ocid» id «data optr00000000D0E1B8EDFF7F0000» into type string. (error -1700)
I’m not sure where the problem exactly arises, so finally I want to have the class-name as a string. Did I missed something? |
_______________________________________________
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