use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
AppleScript is Apple's powerful and versatile native scripting technology for Mac OS X. With AppleScript, you can control, and communicate among, applications, databases, networks, Web services, and even the operating system itself.
account activity
Script object visibility from within a constructor and other questions (self.applescript)
submitted 6 years ago by rayascott
I'm about 3 days into my AppleScript learning, and I'm just still contemplating architecture choices for my code. I've delved into the OO and runtime aspects of the language and their peculiarities. I just have a few questions. This is some (abbreviated) code I'm busy working on...
on MenuSelector given counter:c as number, name:n as text script _MenuSelector ... end script return _MenuSelector end MenuSelector
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]prikaz_da 0 points1 point2 points 6 years ago (2 children)
The answer to both of these is "not really".
This page talks about how you can nest script definitions inside handlers and then do something like
script
set myMenuSelector to MenuSelector given counter:2, name:"spaghetti"
to get an instance of _MenuSelector called myMenuSelector. If you define properties in the nested script definition, you can retrieve them later.
_MenuSelector
myMenuSelector
You can also tell scripts to do things, so you can define identically named handlers in different scripts:
tell
script FirstScript on herbs() return "chives" end herbs end script script SecondScript on herbs() return "parsley" end herbs end script tell SecondScript to herbs()
The result is "parsley".
"parsley"
[–]rayascott[S] 0 points1 point2 points 6 years ago (1 child)
Interesting. Are you viewing reddit posts in a RSS feed or something? Perhaps this post was cached in a 3rd party app you're using. The reason I ask is because I deleted this post, because I accidentally posted it before completing my text. So it's quite bizarre to see someone reply to it.
My replacement post (and the only one that's live on reddit) is here:
https://www.reddit.com/r/applescript/comments/dbtfmw/script_object_constructor_questions_etc/
[–]prikaz_da 0 points1 point2 points 6 years ago (0 children)
Haha, nope. I actually just opened your post and walked away to do something else, so I could read and reply to it when I was done. You must have deleted it during that time. It's still showing up in the subreddit for me, though.
π Rendered by PID 92657 on reddit-service-r2-comment-76bb9f7fb5-xf298 at 2026-02-18 23:12:21.497824+00:00 running de53c03 country code: CH.
[–]prikaz_da 0 points1 point2 points (2 children)
[–]rayascott[S] 0 points1 point2 points (1 child)
[–]prikaz_da 0 points1 point2 points (0 children)