Themes

Need help with a script? This is the place to discuss how to get your code running!

Themes

Postby JoeKoomen2011 » Sun May 14, 2017 2:01 pm

I know that SuperCard is theme compliant, but sometimes I roll my own controls (graphics). Is there a way to check if the OS is set to "Blue" or "Graphite" so I can swap out the images?

I did a cursory search in the language guide and didn't see anything obvious.

Thanks

Joe
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
JoeKoomen2011
 
Posts: 454
Joined: Thu Mar 12, 2009 1:38 pm

Re: Themes

Postby Mike » Sun May 14, 2017 2:35 pm

Hi Joe,

Yes. Tomas Franzén wrote a "getCurrentTheme" external that does this. I'm not sure if he has the external online somewhere or not. He's a friend of mine on Facebook, so I just shot him a message asking him... but with the time zone difference it might be a little while before I hear a response back.
Mike Yenco
YENCO.COM
User avatar
Mike
 
Posts: 210
Joined: Sun Jul 06, 2008 8:54 am
Location: Massachusetts, USA

Re: Themes

Postby Mike » Mon May 15, 2017 8:19 am

Hi Joe,

I just heard back from Tomas. Here it is:
http://tomasf.se/old/supercard/externals/GetCurrentTheme.zip

And here is a script to help you figure it out (in case one isn't provided):

Code: Select all
on mouseUp
  set itemDel to "."
  answer last item of GetCurrentTheme()
end mouseUp


The above should return "blue" or "graphite" if everything works correctly.
Mike Yenco
YENCO.COM
User avatar
Mike
 
Posts: 210
Joined: Sun Jul 06, 2008 8:54 am
Location: Massachusetts, USA

Re: Themes

Postby JoeKoomen2011 » Mon May 15, 2017 9:27 am

Thanks Mike!
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
JoeKoomen2011
 
Posts: 454
Joined: Thu Mar 12, 2009 1:38 pm


Return to Scripting in SuperTalk

Who is online

Users browsing this forum: No registered users and 1 guest