Monday, April 24, 2017

#1 2015-06-10 12:47:45 pm

handell
Member
From: ohio
Registered: 2011-05-24
Posts: 10
Website

Get name of a property's color

property textfield : missing value

   on yesMam_(sender)
    tell class "NSColor" of current application
        set greenColor to its greenColor()
        set redColor to its redColor()
    end tell
   
    textfield's setTextColor_(greenColor)
  end  yesMam_

instead of setting (setTextColor) the color, I want to find out what color it is?

Offline

 

#2 2015-06-10 01:19:14 pm

StefanK
Member
From: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11437
Website

Re: Get name of a property's color

Hi,

first of all please post AppleScriptObjC questions in the AppleScriptObjC forum

it's quite easy

Applescript:


textfield's textColor()


regards

Stefan

Offline

 

#3 2015-06-10 01:58:07 pm

handell
Member
From: ohio
Registered: 2011-05-24
Posts: 10
Website

Re: Get name of a property's color

StefanK wrote:

Hi,

first of all please post AppleScriptObjC questions in the AppleScriptObjC forum

it's quite easy

Applescript:


textfield's textColor()

thanks!!, i guess I was expecting to get the name "greenColor" as a string but I can still use this to do a comparison.

if textfield's textColor()  =  redColor then  ...do something

Offline

 

#4 2015-06-10 02:02:23 pm

StefanK
Member
From: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11437
Website

Re: Get name of a property's color

handell wrote:

i guess I was expecting to get the name "greenColor" as a string

from the initialization you can see that greenColor is an NSColor object and just a variable name (something like a token)


regards

Stefan

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.074 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)