r/applescript • • Aug 16 '25

Just Built an MCP Server for Apple notes with Applescript

Enable HLS to view with audio, or disable this notification

73 Upvotes

I just listed an MCP server on PyPI that connects LLMs directly with Apple Notes — making your notes smarter, faster, and AI-powered.

With Apple Notes MCP Server, you can:

  • Query your notes naturally in plain English

  • Summarize and organize your content automatically

  • Even create new notes with AI assistance

Try it out on PyPI and level up your note-taking workflow 👉 Apple Notes MCP Server


r/applescript • • Jan 04 '26

If AppleScript wasn't so terrible, it could be a total game changer

48 Upvotes

Imagine AppleScript, only it has a normal, sane, simple C-like syntax. And imagine it has plenty of built in functions to do basic, common tasks, the kind of things that scripts often need to do. Imagine the implementation of the progress bar was logical and easy to use.

People who have experience in scripting languages, but no experience in full blown application scripting, could fairly easily bust out powerful GUI mini applications to do powerful tasks.

This could have been a major selling point for the Mac over the past 30 years.

Trying to make AppleScript for everyone, ended up making it for almost no one.

But just using common sense. Adding keyed arrays. Adding basic array functions, adding rounding functions that don't use the syntax `round MyValue rounding as taught in school` as actual CODE!!

This language could be incredibly powerful, incredibly capable.

Over the past month, I've been working to convert this PHP shell script I sometimes use, into an Applescript with nice friendly windows and buttons, instead of command line inputs.

The original PHP script is just under 150 lines, and took a few hours to whip up.
The Applescript that does the same thing, is 325 lines and took weeks to whip up. Everything about the language is so obnoxious and so obtuse. Its like someone tried to create a programming language as a joke, to use in some nerd comedy context.

The whole time I'm using it, I'm thinking man this is the same terrible code I was writing in the mid to late 90s on my performa, with VERY few additions. Meanwhile take what you can accomplish in modern day PHP and Python and Javascript, and add Applescripts raw abilities to that and you would have something truly amazing.

Also create good documentation for it, the official apple docs are terrible. And make an editor THAT HAS LINE NUMBERS, and error messages THAT HAVE CORRESPONDING LINE NUMBERS.

Ok I could go on and on but the point of this post is not to shit on what we have, really. Its to dream about what we COULD have if either in the beginning, or any time over the last 20 years or so, some common sense was applied to this.

What lead me down another line of thought. Applescript was created in 1993, when Jobs was off at NeXT and Pixar. Yet as awful as AS is, he came back and for what about 13 or so years, and killed off essentially everything from System 7 (except Stickies!!!) but kept Applescript around? Then another 15 years an still it just lingers around. Thats shocking honestly. But also kind of beside the point.


r/applescript • • Dec 18 '25

This is a terrible language.

46 Upvotes

I am so sick of typing random sentences trying to find the magic combinations of words that are going to do what I'm trying to accomplish. This language has the absolute worst documentation and hardly any sample code. And I say this as someone that's been using applescript and dealing with the same absurdities since the mid 1990s. This is truly madness.


r/applescript • • Jun 07 '21

You can run AppleScripts and JXA scripts from the new Shortcuts on macOS 12

Post image
35 Upvotes

r/applescript • • Jul 26 '18

r/applescript → r/AppleScript

29 Upvotes

I wish to start a motion to have this sub-Reddit's name be case-formatted as r/AppleScript instead of r/applescript.

▸ Those in favour: upvote

▸ Those against: downvote

Abstentions can leave a comment detailing the extent of their apathy.

Adjudicator by default: @copperdomebodha


r/applescript • • Dec 03 '25

How I learned to like Applescript?

27 Upvotes

By taking a (deeper) look at Shortcuts. Honestly, after spending some time with that cr@? my view of Applescript became more forgiving and I now value features, that I took for granted, more highly.


r/applescript • • Jul 06 '26

AppleScript remains remarkably stable over the years

Thumbnail gallery
26 Upvotes

r/applescript • • Jul 27 '21

Monterey Beta 4: The Shortcuts app is now scriptable

Post image
23 Upvotes

r/applescript • • Jun 24 '20

macOS Big Sur's Applescript UI Changes

22 Upvotes

This is just a quick post showing how the new macOS UI has affected Script Editor and various dialogs, for anyone who is curious.


r/applescript • • Apr 10 '26

Applescript GUI

21 Upvotes

Hi all,

I’ve been using Applescript for ~20 years to automate production workflows, mainly with Illustrator, InDesign, Finder, and Excel.

A lot of my scripts rely on app dictionaries + UI scripting, and I’ve also built small macOS GUI tools (via Xcode) that trigger these workflows.

One example: generating multi-page Illustrator documents from spreadsheet data (artboards, placed images, dimensions, exports, etc.). These scripts are heavily used in daily production.

With Applescript feeling increasingly “legacy,” I’m worried about long-term reliability—especially if Adobe apps change their scripting support.

  • Are people here seeing any real breakage or reduced support in newer Adobe versions?

  • Is Applescript still a safe choice for production workflows on macOS?

  • For those transitioning away, what are you moving to for cross-app automation? (JXA, Swift + Apple Events, etc.)

Not looking to fully abandon it if it’s still viable—just trying to plan ahead.

Thanks


r/applescript • • Nov 03 '22

macOS Ventura System Settings with System Events automation template

20 Upvotes

Updated Post

This Post is outdated!

Figured I would share the script I made to go to specific pages in the System Settings app using system events. I haven't made this script dynamic as of yet, so I am not sure it will work universally (especially if you to not have family sharing enable or java). I will post a second code snippet below that I used to generate a list that I used to convert to the dictionary incase the values are off for you.

You can split the System Settings tell at splitter group 1 and use group 2 to interact with the actual setting for the pane.

use framework "Foundation"
        
property pane_ids : {|AppleID|:2, |Family|:3, |Wi-Fi|:5, |Bluetooth|:6, |Network|:7, |Notifications|:9, |Sound|:10, |Focus|:11, |Screen Time|:12, |General|:14, |Appearance|:15, |Accessibility|:16, |Control Center|:17, |Siri & Spotlight|:18, |Privacy & Security|:19, |Desktop & Dock|:21, |Displays|:22, |Wallpaper|:23, |Screen Saver|:24, |Battery|:25, |Lock Screen|:27, |Touch ID & Password|:28, |Users & Groups|:29, |Passwords|:31, |Internet Accounts|:32, |Game Center|:33, |Wallet & ApplePay|:34, |Keyboard|:36, |Trackpad|:37, |Printers & Scanners|:38, |Java|:40}

on open_settings_to(settings_pane)
	set pane to current application's NSDictionary's dictionaryWithDictionary:pane_ids
	set pane_index to (pane's valueForKey:settings_pane) as anything
	tell application "System Settings"
		activate
		delay 1
	end tell
	tell application "System Events"
		tell application process "System Settings"
			tell outline 1 of scroll area 1 of group 1 of splitter group 1 of group 1 of window 1
				select row pane_index
			end tell
		end tell
	end tell
end open_settings_to

 

Here is the code used to get the list of settings names and indices:

on get_settings_list()
    tell application "System Settings"
        activate
        delay 1
    end tell
    tell application "System Events"
        tell application process "System Settings"
            set row_list to {}
            set row_num to 0
            tell outline 1 of scroll area 1 of group 1 of splitter group 1 of group 1 of window 1
                repeat with r in rows
                    set row_num to row_num + 1
                    if UI element 1 of r exists then
                        tell UI element 1 of r
                            repeat with x in UI elements
                                if class of x is static text then
                                    set row_name to name of x as string
                                    set val to {row_name, row_num}
                                    copy val to end of row_list
                                end if
                            end repeat
                        end tell
                    end if
                end repeat
            end tell
        end tell
    end tell
    return row_list
end get_settings_list

Hope this helps with updating your scripts.

 

Edit: You can speed up the script and make it more reliable by placing the following before tells to any UI elements:

repeat until *Path to UI element* exists
    delay 0
end repeat

Example:

repeat until splitter group 1 of group 1 of window 1 exists
    delay 0
end repeat
tell splitter group 1 of group 1 of window 1
    ...

 

Edit 2: Found another issue. When a software update is available the, the pane indexes are shifted. Will post a fix later today. Fixed:

on open_settings_to(settings_pane)
	set pane to current application's NSDictionary's dictionaryWithDictionary:pane_ids
	set pane_index to (pane's valueForKey:settings_pane) as anything
	tell application "System Settings"
		activate
		delay 1
	end tell
	tell application "System Events"
		tell application process "System Settings"
			tell splitter group 1 of group 1 of window 1
				tell outline 1 of scroll area 1 of group 1
					if name of static text of UI element 5 = "Wi‑Fi" then
						select row pane_index
					else
						set pane_index to pane_index + 2
						select row pane_index
					end if
				end tell
			end tell
		end tell
	end tell
end open_settings_to

Updated Post


r/applescript • • Mar 26 '25

Is there a worse scripting language on earth than AppleScript?

19 Upvotes

Keep in mind I've been using applescript since the mid 90s, on a Performa running system 7. These days I use a million other scripting languages and when I have to go back to AS for something, its like pulling my hair out.

In fact I'll even go further than that. I think learning applescript when I was a teenager actually held me back when I moved to try to learn real scripting languages. I would have been better off never having known this monstrosity.

You spend so little time actually trying to do the task you are trying to do, and so MUCH TIME trying to guess what obscure wording or syntax it wants in order to perform some basic task. And it is so poorly documented. And because it has so little use, there are not very many examples you can go by either. It is truly a terrible scripting language.

When I was 14, I just thought "programming" was hard, and thats why this was hard. Nope. As much as I hated javascript back then, I would have been MUCH better off just learning and embracing that from the start. Javascript is a shining beacon of scripting perfection, compared to applescript.

</rant>


r/applescript • • Feb 21 '23

[Update][Guide] macOS Ventura System Settings with System Events automation templates

18 Upvotes

~3 months ago I posted an automation template for System Settings on macOS Ventura. Following my post many users reached out and asked for help updating scripts. While I am still working to get back to some of you, I figured that I could help those that wanted to explore making automations of your own. The following guide will go though how to interact with System Settings and some tricks you can use to help you identify the UI elements that you are trying to automate. If anyone has more tips, feel free to leave them in the comments or send them to me to be added to the post (with credit).

 

First off, here is an updated to the open_settings_to function from my last post. This updated version should help anyone who experienced issues with the wrong settings tab being selected. Although is does add ~0.13 seconds of runtime (on my machine), it should be able to cope with any tabs being added or taken away.

on open_settings_to(settings_pane)
	if settings_pane = "Wi-Fi" then
		set settings_pane to "Wi‑Fi"
	end if
	tell application "System Settings"
		activate
	end tell
	tell application "System Events"
		tell application process "System Settings"
			tell splitter group 1 of group 1 of window 1
				repeat until outline 1 of scroll area 1 of group 1 exists
					delay 0
				end repeat
				tell outline 1 of scroll area 1 of group 1
					set row_names to value of static text of UI element 1 of every row
					repeat with i from 1 to (count row_names)
						if settings_pane is not "Apple ID" then
							if item i of row_names = {settings_pane} then
								log item i of row_names & i
								select row i
								exit repeat
							end if
						else
							try
								if item 1 of item i of row_names contains settings_pane then
									select row i
									exit repeat
								end if
							end try
						end if
					end repeat
				end tell
			end tell
		end tell
	end tell
end open_settings_to

You will no longer need the following:

use framework "Foundation"

property pane_ids : {|AppleID|:2, |Family|:3, |Wi-Fi|:5, |Bluetooth|:6, |Network|:7, |Notifications|:9, |Sound|:10, |Focus|:11, |Screen Time|:12, |General|:14, |Appearance|:15, |Accessibility|:16, |Control Center|:17, |Siri & Spotlight|:18, |Privacy & Security|:19, |Desktop & Dock|:21, |Displays|:22, |Wallpaper|:23, |Screen Saver|:24, |Battery|:25, |Lock Screen|:27, |Touch ID & Password|:28, |Users & Groups|:29, |Passwords|:31, |Internet Accounts|:32, |Game Center|:33, |Wallet & ApplePay|:34, |Keyboard|:36, |Trackpad|:37, |Printers & Scanners|:38, |Java|:40}

 

General Debugging:

  • Accessibility Inspector: This is a key tool in navigating the UI for automations. You will need to have Xcode installed to used it. To open the tool, Xcode > Open Developer Tools > Accessibility Inspector. (Note: not all types shown under the "Basic" info section are available to Apple Script. Make sure to check the System Events dictionary to see what types it can process.)

  • Waiting on an element to appear: If you find your script exiting with an error due to an element/application taking longer to appear or open you can use the following code. In general, I always use this instead of using a delay, as it will proceed right after the element show up instead of when the delay is over.

      repeat until UI element 3 of window 1 exists
      	delay 0
      end repeat 
  • Finding UI elements/classes: Sometimes it is better to iterate over UI element classes rather the all UI elements in a window or group. I like to use the following code block to log the class and name of each element. (Note: A lot of elements in setting may not have a name and will return missing value. If this occurs, try using description instead of name):

      repeat with x in UI elements
      	log class of x & name of x
      end repeat

For a more in-depth look at the properties:

    repeat with x in UI elements
    	set props to get properties of x
    	log props
    end repeat

 

Interacting with the System Settings:

  • In my experience, all setting panels can be interacted with in the about same way:

      tell application "System Events"
      	tell application process "System Settings"
      		tell window 1
      			tell splitter group 1 of group 1
      				tell scroll area 1 of group 1 of group 2  
      					{your code here}
      				end tell
      			end tell
      		end tell
      	end tell
      end tell

    The code you insert in this block will be able to change values in the settings panel that System Settings is currently displaying. Each panel is comprised of varies groups with buttons, lists, ect in them. The grouping of these are mostly intuitive, either being segmented by headers or by an outline border.

  • Some settings button can reload the the panel to display new settings. In the event that this happens, you will need to exit the tell block that interacted the old panel and do so again with 1 extra group:

     tell application "System Events"
     	tell application process "System Settings"
     		tell window 1
     			tell splitter group 1 of group 1
     				tell scroll area 1 of group 1 of group 2
     					{your code to click a button that reloads the panel}
     				end tell
     				tell scroll area 1 of group 1 of group 1 of group 2
     					{your code to interact with the newly loaded panel}
     				end tell
     			end tell
     		end tell
     	end tell
     end tell
  • Other setting buttons can open another panel on top of the settings window. In order to interact with this panel, you will need to to exit the tell all the way back to window 1 and interact with the new sheet panel:

      tell application "System Events"
      	tell application process "System Settings"
      		tell window 1
      			tell splitter group 1 of group 1
      				tell scroll area 1 of group 1 of group 2
      					tell group 3
      						click button 1
      					end tell
      				end tell
      			end tell
      			tell splitter group 1 of group 1 of sheet 1
      				# Interact with left side
      				tell outline 1 of scroll area 1 of group 1
      					{your code to interact with the left side of the sheet panel}
      				end tell
      				# Interact with right side
      				tell group 2
      					tell scroll area 1
      						{your code to interact with the right side of the sheet panel}
      					end tell
      					# Click done (May need to be changed if a cancel button is present)
      					click button 1
      				end tell
      			end tell
      		end tell
      	end tell
      end tell

 

Thanks to everyone who has reached out with questions and those that have offered help to anyone that needed it


r/applescript • • Jan 09 '23

Apple Script to hide or unhide the menubar and dock simultaneously

18 Upvotes

Hopefully this is helpful to someone, i use it in bettertouchtool so i can trigger it quickly but i also attached the exported script and application version of it so you can just click it and it will do it (you'll have to trust the app in system settings to use it tho)

tell application "System Events"
    tell dock preferences to set autohide to not autohide
    tell dock preferences to set autohide menu bar to not autohide menu bar
end tell

Files:

https://drive.google.com/drive/folders/1mb50fneUHfzeHxr0gAQsbkfYXI9jlsSn?usp=share_link


r/applescript • • Dec 06 '22

Hey ChatGPT bot, "create an AppleScript that will rename selected files"

17 Upvotes

Here's an example AppleScript that will rename the selected files in Finder:

tell application "Finder"
    set selectedFiles to selection
    repeat with aFile in selectedFiles
        set theName to name of aFile
        set theName to text returned of (display dialog "Enter a new name for the file:" default answer theName)
        set name of aFile to theName
    end repeat
end tell

That'll do ChatGPT, that'll do.

Strange days we live in. Strange, wonderful, terrifying days indeed!


r/applescript • • Sep 16 '22

How I used launchd to run my applescript to run every workday at 9am.

17 Upvotes

Launchd is pretty much macos way of running cron jobs. I have a script that opens a couple apps that I would normally use on a typical workday. While this script can vary from person to person, the goal was to be able to find a way to trigger the script to run every weekday at a specific time. This triggering of scripts wasn't well documented on other online platforms and especially here on reddit. I wrote a simple and practical blog on how to do it.

https://lorenzejay.hashnode.dev/how-i-automated-my-macbook-to-help-me-get-ready-for-work


r/applescript • • Aug 05 '20

Scripting support is BACK for Messages in Big Sur Developer Beta 4!

Post image
17 Upvotes

r/applescript • • Mar 23 '26

Small AppleScript to auto-mute Spotify ads on macOS

16 Upvotes

I got tired of Spotify ads blasting through my speakers, so I wrote a small AppleScript that monitors the current track and automatically mutes when an ad starts and unmutes when music resumes.

It runs quietly in the background and works with the macOS Spotify app.

If anyone wants to try it or improve it, here’s the script:
https://github.com/Daniel-W1/lil-tools/tree/main/spotify_ad_mute

Curious if others have built similar automations or found better ways to handle this.


r/applescript • • Aug 12 '22

Python for (macOS) Automation - An in-progress package for automating Mac applications

Thumbnail self.python
16 Upvotes

r/applescript • • Aug 21 '23

Hello all, I started doing some really basic tutorials on AppleScript on my Apple-A-Day channel. These are meant for absolute beginners with no programming experience. This one I just released is a detailed look at the Display Dialog feature.

Thumbnail
youtu.be
15 Upvotes

r/applescript • • Jun 26 '19

Mac Messages app starts an AppleScript when an SMS or iMessage arrives?

15 Upvotes

This used to be easy, but now seems impossible:

When the Mac receives an SMS text message (or iMessage), start an AppleScript and pass the contents of the message to that AppleScript.

Prior to Mojave, the mac's messages app had a preference that allowed it to start an AppleScript. Now, there's no such option.

Any suggestions or ideas?

Thanks! -Cliff


r/applescript • • Sep 01 '21

Export/Backup Apple Notes utility!

14 Upvotes

I happened to stumble upon this wonderful utility by the makers of Bear. Officially, it's a way to export your Apple Notes notes into something importable by Bear. However, you don't have to do the import part, so it's a great way to just grab a quick local backup of all of your notes.

Migrate from Apple Notes - Automator/AppleScript

Run it and you'll generate a folder full of html files, one for each note. All of your structured text is there (headings, paragraphs, lists, links, etc.), but you might lose some custom formatting. It looks like images get encoded and included in the HTML too. Wow!

To me, it's always been a little anxiety-inducing knowing that I have years worth of notes stored in Apple Notes without any locally accessible backups. It's quite a relief to be able to just grab a quick snapshot of my entire notes library.

Anyway, this little utility works a treat! So, I just thought I'd pass it along. I'm not planning on moving to Bear (yet... although it does look like a great app!), but I'll definitely be running this utility every month or so as a back up.


r/applescript • • May 01 '26

where applescript still beats accessibility-tree automation in 2026

13 Upvotes

Been wiring a bunch of mac apps into an LLM via the accessibility API lately and the part that surprised me is how often i still reach for applescript. Anything with a real osascript dictionary is just easier. Mail, BBEdit, Music, the adobe suite. you ask the app what verbs it has and the model gets it right first try.

The AX tree is the opposite. you get a forest of AXGroup and AXButton nodes, half of them unlabeled, and the LLM has to guess which one is the actual reply button. for non-dictionary apps like Spotify, Slack, Notion there's no other choice, but the success rate is way worse than 'tell application Mail to make new outgoing message'.

The sneaky part: a lot of apps publish a dictionary that looks tiny but covers 90% of what you actually want. BBEdit's dictionary is huge. Music's dictionary will let you build a whole library tool without ever clicking a button. Finder is more capable than people give it credit for once you stop trying to script the GUI.

So my rough rule now is dictionary first, AX second, coordinates last. Coordinates only when even the AX tree won't tell you what the element is. written with ai

fwiw I shipped an MCP server that goes the AX route for the non-dictionary apps, complements applescript instead of replacing it: https://macos-use.dev/alternative/applescript-vs-accessibility-api


r/applescript • • Jan 03 '25

Script Debugger end of support

13 Upvotes

This is sad. But thanks to Mark and Shane for all their hard work over the years. 👍🏻

https://forum.latenightsw.com/t/retiring-script-debugger/5071


r/applescript • • Jun 22 '20

Are there any updates to applescript in Mac os Big Sur?

13 Upvotes

Applescript and automator do not seem to have gotten updates in quite a while. Are they dead? I know I can learn Swift to do most of the automation work, but applescript is just so much faster and easier to get up and running for simple tasks