Thursday, October 17, 2019

#1 2019-09-04 11:17:59 am

markconwaymunro
Member
Registered: 2017-11-28
Posts: 41
Website

Equivalent of global variable

I am not sure how to even phrase this question terminologically.

I have two class scripts, all is working well. The only problem is that global variables in each are completely separate and must be initialized by each script. I am looking for a way to have other scripts inherit/share global variables from the AppDelegate in a way similar to how it happens when an AppleScript loads another script.

Is that even possible?

Offline

 

#2 2019-09-04 05:36:28 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5959

Re: Equivalent of global variable

No. You really have two alternatives: use defaults to pass stuff around, or declare variables in your app delegeate and access them via NSApp's delegate()'s ....


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Online

 

#3 2019-09-04 08:23:02 pm

markconwaymunro
Member
Registered: 2017-11-28
Posts: 41
Website

Re: Equivalent of global variable

Thanks. That's what I figured but wanted to make sure there wasn't some trick I of which I was unaware...

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)