Hello,
We are working on automating some processes for our mac virtual machines pool, and one of the things we are looking for is where we can download various different versions of macOS.
When going to the download section of the apple dev portal, it only gives a download link of the latest macOS. Is there no way to obtain download URLs for previous macOS versions as well? For instance, we are trying to validate our automation scripts against Sonoma macOS so we are looking for the download URL , to put in our scripts , or to manually download the file ourselves.
Thanks!
Automation & Scripting
RSS for tagLearn about scripting languages and automation frameworks available on the platform to automate repetitive tasks.
Post
Replies
Boosts
Views
Activity
I often need to remotely control a Mac that has the Remote Desktop application running on it. Thus I need to create a script to kill it remotely. The following command gives me the process number (PID) on the remote machine when logged in via SSH. What I need to know is how to pass that number to kill -3 to quit it with one command, bad thing can happen if you make a typo on PID
ps -ax | grep "Remote Desktop.app" | grep -v grep | awk '{print $1}'
I keep seeing that there's a shortcut called "Add transaction" where whenever a card was tapped from apple wallet, you can add some automation.
https://support.apple.com/en-au/guide/shortcuts/apd65c67538a/7.0/ios/17.0
However, I cannot for the life of me find this option on my iphone 13 ios 17.6.1
All I can find when I go to the shortcuts app and search for transactions or apple wallet, I get 2 options to send/receive payments which isn't what I'm looking for.
Did apple remove this shortcut??
Hello.
I have NFC tags that I scan before walking my dog, that set off a list of shortcuts.
The shortcuts have been failing the last couple of weeks but were fine before that. seems to be a problem with linking to starting a walk in apple watch workouts?!
I have the latest iOS 18 public beta running (18.1) and watchOS 11.0.1
In the Swift function at the end of this post, I use Scripting Bridge to have Finder delete a path. The variable result is a SBObject returned by the delete() function. I know that result somehow contains the new path of the deleted item in the trash folder, but I don't know how to nicely extract it as a single String.
If I print(String(describing: result)), I get output like:
<SBObject @0x0123456789ab: <class 'appf'> "AppName.app" of <class 'cfol'> ".Trash" of <class 'cfol'> "user" of <class 'cfol'> "Users" of startupDisk of application "Finder" (822)>
Is there any way to obtain the String "/Users/user/.Trash/AppName.app" from result without having to perform string parsing on the above output?
The Finder* types in the code below are from https://github.com/tingraldi/SwiftScripting/blob/master/Frameworks/FinderScripting/FinderScripting/Finder.swift
func trash(path: String) throws {
guard let finder: FinderApplication = SBApplication(bundleIdentifier: "com.apple.finder") else {
throw runtimeError("Failed to obtain Finder access: com.apple.finder does not exist")
}
guard let items = finder.items else {
throw runtimeError("Failed to obtain Finder access: finder.items does not exist")
}
let object = items().object(atLocation: URL(fileURLWithPath: path))
guard let item = object as? FinderItem else {
throw runtimeError(
"""
Failed to obtain Finder access: finder.items().object(atLocation: URL(fileURLWithPath: \
\"\(path)\") is a '\(type(of: object))' that does not conform to 'FinderItem'
"""
)
}
guard let delete = item.delete else {
throw runtimeError("Failed to obtain Finder access: FinderItem.delete does not exist")
}
let result = delete()
}
Is there a way for my app to know that a phone number has just been messaged to or a call to 911 just started? Or SOS has just been executed by the user?
I want to create an Apple Shortcut that responds to text messages I receive while on vacation with an Out of the Office message.
However, I want to exclude some people from getting this message, namely family and work colleagues. Does anyone know how to do this on iOS 18. I'm stuck on how to exclude contacts I don't want to send the message to.
Does anyone know how to do this?
Hello,
There is a new shortcut recently in iOS shortcuts called "Open [Pass or Card]". It looks to take in a [Pass or Card] type, however I'd like to program it with a shortcut to dynamically select a card, and I noticed it works with strings, such as "BofA Customized Cash Rewards".
Would there be a list of possible strings for supported cards and/or passes that I could pass in for this shortcut?
I have a VBScript routine to print envelopes by automating Word. This works just fine.
Now I'm trying to do the same thing with AppleScript, also using the Word application. Here is what I have so far:
set recipientAddress to text returned of (display dialog "Enter the recipient's address:" default answer "")
-- Prompt for recipient city, state, and zip
set recipientCityStateZip to text returned of (display dialog "Enter the recipient's city, state, and zip:" default answer "")
-- Combine all address parts into a full address
set fullAddress to recipientName & return & recipientAddress & return & recipientCityStateZip
-- Create a new Word document and print the envelope
set dialogResult to display dialog "To print envelope for:" & return & return & recipientName & return & recipientAddress & return & recipientCityStateZip & return & return & "Center envelope upside-down in printer with flap on left" & return & return & "Continue?" buttons {"Yes", "No"} default button 2 with icon caution
if button returned of dialogResult is "Yes" then
tell application "Microsoft Word"
set wdDoc to make new document
-- Print the envelope with the collected recipient address and hard-coded return address
-- wdDoc's print out envelope(address:fullAddress, returnAddress:returnAddress)
-- Close the document without saving
close wdDoc saving no
end tell
end if
What does NOT work is the commented line near the end of the script which starts with -- wdDoc's print out envelope...
Either I am doing it wrong, or Word for Mac can't be automated that way. Can anyone help with this script, or at least suggest a different method to print an envelope on demand?
Thanks...
Context
I'm working on a Mail.app plugin. I would like to disseminate plugin via AppStore.
I'm interested in exposing a functionality to user enabling user to choose if plugin should apply to all or selected email account.
My intention is to use AppleScript to get a list of available email accounts and expose the list to the end-user via SwiftUI
Sourcing account information
Apple Script
I'm using the following AppleScript
tell application "Mail"
set accountDict to {}
repeat with acc in accounts
set accName to name of acc
set accEmails to email addresses of acc
set accountDict's end to {accName:accEmails}
end repeat
return accountDict
end tell
The above generates expected results when executed using Script Editor.
Swift Implementation
This is still incomplete but shows the overall plan.
//
// EmailAccounts.swift
import Foundation
enum EmailScriptError: Error {
case scriptExecutionError(String)
}
struct EmailAccounts {
func getAccountNames() -> [String]? {
let appleScriptSource = """
tell application "Mail"
set accountDict to {}
repeat with acc in accounts
set accName to name of acc
set accEmails to email addresses of acc
set accountDict's end to {accName:accEmails}
end repeat
return accountDict
end tell
"""
var error: NSDictionary?
var accountNames: [String] = []
// Create script object, exit if fails
guard let scriptObject = NSAppleScript(source: appleScriptSource) else {
return nil
}
// Execute script and store results, nil on error
let scriptResult = scriptObject.executeAndReturnError(&error)
if error != nil { return nil }
// Iterate over results
for index in 0...scriptResult.numberOfItems {
if let resultEntry = scriptResult.atIndex(index) {
if let resultString = resultEntry.stringValue {
// Process result handling
// accountNames.append(resultString)
}
}
}
return accountNames
}
}
Questions
Most important one, can I deploy the App on the App Store and use NSAppleScript as shown above?
If yes can I use the script in the manner shown above or will I need to store the script in User > Library > Application Scripts location and source it from there. This is outlined in the Scripting from a Sandbox article by Craig Hockenberry, which I cannot link due to being hosted within a not-permitted domain.
If yes what entitlements I need to give to the target.
I understand that I wouldn't be able to use ScriptingBridge, which feels more robust but wouldn't permit me to deploy the app on the AppStore.
My key objective is to programatically identify mail accounts available to Mail.app, if there is a wiser / easier way of doing that I would be more than receptive.
I’ve developed an automation and shortcut using the iPhone Shortcuts app in IOS 18, something that hasn’t been done before. With support from Apple’s customer service, I was encouraged to bring this idea to life.
The automation’s purpose is to open a specified iOS app, move it to the background, and use a txt database in Folders to ensure uninterrupted data flow and continuous connectivity—especially useful for health apps where wearable devices need consistent, uninterrupted operation and monitoring (e.g., doctor tracking or wearable device connectivity). I would like to share the Automation and the Shortcut with the community.
I'm trying to study music theory and I need a simple series of tasks to be automated to avoid wasting time on repetitive actions. That's what the Shortcuts app is for, but the actions it comes with are either severely mislabeled, or just don't work. I tried to ask for this in some regular forums and nobody could give me a simple answer, so I figured this is something that developers probably know.
I just need four PDFs to open in Preview, their windows moved to one of my monitors, and then be tiled in four equal sizes, with the order determined by me. Sounds easy, doesn't it? But I've been trying to accomplish this for over a year in Shortcuts and even Automator, but at best I can get halfway there.
I've also noticed that the Shortcuts I had prepared are running awfully slow. I'm on a Mac Studio M1 Ultra, and these PDFs are less than 10 MB each, three of them are less than 5 MB. These used to open almost instantly, but now the first one opens, then 3-5 seconds later the next one opens and so on.
As for the window tiling, at best it's tiling three of the windows correctly, but the other one that should tile on the top left, doesn't resize to the quarter of the screen. But worst of all, they are supposed to move to one of the monitors and do the tiling there, but they all open and tile on the main monitor.
So this is one I started today from scratch:
Logically speaking, this should work. But either I'm not following the logic with which Shortcuts was designed, or Shortcuts just doesn't work very well. I'm hoping it's just that I don't follow the logic, but the help is not very helpful. It's rather scant, and other than that, I can't find something that will give me more information about how it works. I'm on the current version of Sonoma, but this was the same in the previous macOS. I doubt it changed at all in Sequoia.
Sorry if I'm asking this in a developer forum, but I figured it's the place where I can finally get some answers after over a year of trial and error and online searching and getting nowhere.
Description
The Shortcut Automation Trigger Transaction frequently times out, ultimately causing the shortcut automation to fail. Please see the attached trace for details.
Additionally, the Trigger is activated even when the Transaction is declined.
Details
In the trace I see the error:
[WFWalletTransactionProvider observeForUpdatesWithInitialTransactionIfNeeded:transactionIdentifier:completion:]_block_invoke Hit timeout waiting for transaction with identifier: <private>, finishing.
Open bug report: FB14035016
Suppose I want to create a dummy switch for HomeKit using an app.
I run the app for the first time, the app registers itself as a dummy switch and all accessories see the app as an OFF switch.
The following day, I run the app again and turn the dummy switch ON. All accessories that were monitoring the status of that switch, adjusted themselves accordingly, run their automations and so on.
Can an app do that in iOS, macOS, iPadOS, watchOS, etc.?
If so, can you point me in the right direction?
I have implemented a custom AppIntent in a macOS (14+) application and also added AppShortcuts. However whenever I try to launch it from Siri I get "Sorry something went wrong". In the documentation it states that Siri should automagically index and pick up these shortcuts/ intents. What ma I missing ?
Dear community, 3 Questions
1 On which processor are shortcuts being executed (the script flow) when started from Apple Watch?
2 Same question for the single intents execution.
3 Is there a good documentation and hopefully some architectural block diagram?
Hello all, I need some guidance please. Since recent security changes at Microsoft. AppleMail and Outlook on my very old MacBook (El Capitan) can no longer send/recieve emails as authorisation cannot bind. Before I could automate email (hotmail account) sending with AppleScript. I now use a web mail page for Outlook via Chrome but having to send manually. Can I get some advice on how to control, with AppleScript, the attached webpage to:
open a new email
add recipient in the To field
add a subject
attach a file
send email.
Or is there another solution (apart from buying a newer Mac!). Thank you
Hello, I don't know much about AppleScript, but I found this script on a Raycast site that dismisses Notification Center notifications. It worked great on Sonoma but has stopped working in Sequoia. Here is the code:
tell application "System Events"
tell process "NotificationCenter"
if not (window "Notification Center" exists) then return
set alertGroups to groups of first UI element of first scroll area of first group of window "Notification Center"
repeat with aGroup in alertGroups
try
perform (first action of aGroup whose name contains "Close" or name contains "Clear")
on error errMsg
log errMsg
end try
end repeat
-- Show no message on success
return ""
end tell
end tell
When using this to attempt to dismiss notifications, it returns the following error:
Can’t get scroll area 1 of group 1 of window "Notification Center" of process "NotificationCenter". Invalid index. (-1719)
Please help me fix it so it will run in Sequoia! This script was super useful.
Hi everyone,
I have a shortcut that works great on iOS and on MacOS but that for some reason, doesn't work on WatchOS.
The shortcut contains only a "Run script over SSH" item, I've tested both with password and public Key, they work well on the other devices but in WatchOS they shortcut returns "Cannot send with an inactive account".
Any idea of what the issue is?
Regards,
Ade
I have an app intent that returns a file from inside the Sandbox.
With iOS 18 RC, the call to INFile results in the file being deleted, instead of the file being returned.
intentResponse.file = INFile(fileURL: fileURL, filename: fileName, typeIdentifier: nil)
This seems to happen if the file was created by an earlier Shortcut action that calls FileManager().copyItem(), but not for files created by other means.
I haven't found a reference in the developer documentation about INFile resulting in the file being deleted.
I can block FileManager() from deleting the file by setting its immutable attributes to true, but that prevents me from removing it later.