Sample Header Ad - 728x90

Ask Different (Apple)

Q&A for power users of Apple hardware and software

Latest Questions

0 votes
1 answers
139 views
How do I modify the folder screenshots are saved to in this AppleScript in Automator?
This apple script seems to be doing exactly what I wanted it to do, (save screenshots both to a file location and to the clipboard) but I can't for the life of me figure out how to change this script to point at a different folder (currently it is saving to the Desktop) I'm not very familiar with Au...
This apple script seems to be doing exactly what I wanted it to do, (save screenshots both to a file location and to the clipboard) but I can't for the life of me figure out how to change this script to point at a different folder (currently it is saving to the Desktop) I'm not very familiar with Automator or AppleScript and haven't been able to pin down where that is being set so that I can change it This line looks relevant: set thePathFilename to POSIX path of (path to desktop folder as string) & theFilename And this is the full script on run {input, parameters} -- # Screen Shot to Clipboard and File -- # Clear the clipboard so the 'repeat until isReady ...' loop works properly. set the clipboard to "" -- # Copy picture of selected area to the clipboard, press: ⌃⇧⌘4 -- # Note that on my system I need to keystroke '$' instead of '4'. -- # I assume this is because the 'shift' key is being pressed. tell application "System Events" keystroke "$" using {control down, shift down, command down} end tell -- # Wait while user makes the selection and releases the mouse or times out. -- # Note that the time out also acts as an escape key press of sorts. In other -- # words, if the user actually presses the escape key it has no effect on this -- # script like it would if pressing the normal shortcut outside of the script. -- # -- # As coded, the time out is 5 seconds. Adjust 'or i is greater than 10' and or -- # 'delay 0.5' as appropriate for your needs to set a different length time out. -- # This means, as is, you have 5 seconds to select the area of the screen you -- # want to capture and let go of the mouse button, otherwise it times out. set i to 0 set isReady to false repeat until isReady or i is greater than 10 delay 0.5 set i to i + 1 set cbInfo to (clipboard info) as string if cbInfo contains "class PNGf" then set isReady to true end if end repeat if not isReady then -- # User either pressed the Esc key or timed out waiting. return -- # Exit the script without further processing. end if -- # Build out the screen shot path filename so its convention is of -- # the default behavior when saving a screen shot to the Desktop. set theDateTimeNow to (do shell script "date \"+%Y-%m-%d at %l.%M.%S %p\"") set theFilename to "Screen Shot " & theDateTimeNow & ".png" set thePathFilename to POSIX path of (path to desktop folder as string) & theFilename -- # Retrieve the PNG data from the clipboard and write it to a disk file. set pngData to the clipboard as «class PNGf» delay 0.5 try set fileNumber to open for access thePathFilename with write permission write pngData to fileNumber close access fileNumber on error eStr number eNum try close access fileNumber end try activate display dialog eStr & " number " & eNum buttons {"OK"} default button 1 with title "File I/O Error..." with icon caution end try -- # Convert the POSIX path filename to an alias. set thePathFilename to POSIX file thePathFilename as alias -- # Hide the file extension as is the default. tell application "Finder" try set extension hidden of thePathFilename to true end try end tell Which I found here: Copy screenshot to clipboard in addition to saving the file
Benjamski (1 rep)
Nov 17, 2022, 05:31 PM • Last activity: Aug 5, 2025, 01:07 AM
0 votes
0 answers
17 views
Open app two spaces to the left of Desktop using Automator
Would like to open an app (say Apple Music) two spaces to the left of Desktop using Automator Apple Mail already reliably opens one space to the left of Desktop (I'm not sure how but it does). I think its possible with an Apple Script but I'm not sure of the syntax.
Would like to open an app (say Apple Music) two spaces to the left of Desktop using Automator Apple Mail already reliably opens one space to the left of Desktop (I'm not sure how but it does). I think its possible with an Apple Script but I'm not sure of the syntax.
pmagunia (1171 rep)
Aug 3, 2025, 08:59 PM
0 votes
1 answers
46 views
Automating blocking a contact and deleting a message in Mail app
If I select an Apple Mail Message and right click it, a pop up appears with several choices including **Block Contact** and **Delete**. I'm trying to create a little Automator and/or AppleScript routine that will do both to a selected message, but I don't know where to find the AppleScript commands...
If I select an Apple Mail Message and right click it, a pop up appears with several choices including **Block Contact** and **Delete**. I'm trying to create a little Automator and/or AppleScript routine that will do both to a selected message, but I don't know where to find the AppleScript commands to tell Mail what to do other than **tell** *application* "Mail".
miamistax (1 rep)
Mar 2, 2025, 12:28 AM • Last activity: Aug 2, 2025, 06:05 AM
15 votes
10 answers
12213 views
Fixing "not allowed to send keystrokes" error in Automator workflow
MacOS Ventura 13.3 but I have had some form of this problem on and off for a couple years. I have a simple workflow that types the current date in ISO 8601 format, it is a single AppleScript action like `tell application "System Events"...keystroke $DATE` essentially. It breaks, often, with an error...
MacOS Ventura 13.3 but I have had some form of this problem on and off for a couple years. I have a simple workflow that types the current date in ISO 8601 format, it is a single AppleScript action like tell application "System Events"...keystroke $DATE essentially. It breaks, often, with an error saying the workflow is "unable to send keystrokes". Perhaps something resets on OS upgrades, I'm not sure, but I wish I better understood the steps necessary to fix it. I gave Automator, AppleScript Utility, and the workflow itself the Accessibility permission "allow the applications below to control your computer"—as [this answer says](https://apple.stackexchange.com/a/401262/67860)—but that alone does not seem sufficient (but might be necessary?). I don't see any relevant keyboard settings. I suspect some or all of these apps also need to be on the Settings > Privacy & Security > Automation list...except there is no way to add (or remove, for that matter) apps to that list. There is no "plus" button and dragging an app onto the list does nothing. I've read here and in Apple's forums some suggestions that an app is supposed to request this permission the first time it needs it and to add an app to the list you should reinstall it. A fine solution...but you cannot reinstall Automator _or_ AppleScript Utility, they cannot be deleted. The workflow itself also does not trigger a prompt for this permission, as far as I can tell, and I doubt giving it access would be enough. **How is one supposed to add applications to the Automation list?** Is there a CLI to this list?
phette23 (331 rep)
Mar 29, 2023, 04:34 PM • Last activity: Jul 31, 2025, 04:53 AM
0 votes
3 answers
526 views
Keyboard shortcut (or automator app) to open currently open finder window?
I have a Stream Deck and I am hoping I can make a button I can press that will activate finder and move me to a currently open finder window - just as if I clicked on Finder on the Dock. (I can do this for every other app by just launching the app) I figured out how to "launch" finder by launching t...
I have a Stream Deck and I am hoping I can make a button I can press that will activate finder and move me to a currently open finder window - just as if I clicked on Finder on the Dock. (I can do this for every other app by just launching the app) I figured out how to "launch" finder by launching the Finder app tucked away in the System folder, but it doesn't quite do what I want (see below.) I've gotten very close from these other articles: https://apple.stackexchange.com/questions/114933/is-there-a-keyboard-shortcut-to-bring-up-finder https://apple.stackexchange.com/questions/322902/how-to-automate-right-clicking-finders-dock-icon-and-choosing-action But they all do the same thing as > open -a Finder in terminal——they make Finder active, but *if I have a finder window open on another monitor in full screen* it does not move to it, it only shows Finder in the menu bar. I can't seem to find a way emulate the exact action of clicking the icon in the dock, which *does indeed* jump to the correct "spaces desktop" (full screen Finder window) on another monitor, whether via keyboard shortcut, shortcuts app, stream deck's app, automator, AppleScript, or terminal command - however I am by no means an expert in automator, Shortcuts, AppleScript, or terminal. I tried "watch me do" in automator, and it'd work if I didn't hide my dock, but I do. :/
Dusey (21 rep)
Sep 12, 2022, 09:54 PM • Last activity: Jul 29, 2025, 02:10 PM
2 votes
2 answers
1977 views
Automator.app "Watch me do" loop gets slower and slower
I have been using Automator to run "Watch Me Do" loop to click places repeatedly for tedious tasks. The loop works perfectly, but the longer the loop runs for over time the mouse movement and clicks get slower and slower. Relaunching Automator does not reset the slowdown. The only "fix" I have found...
I have been using Automator to run "Watch Me Do" loop to click places repeatedly for tedious tasks. The loop works perfectly, but the longer the loop runs for over time the mouse movement and clicks get slower and slower. Relaunching Automator does not reset the slowdown. The only "fix" I have found is to reboot my MacOS. Anyone here know how to fix this?
Veronica (123 rep)
Oct 24, 2020, 09:42 PM • Last activity: Jul 28, 2025, 08:09 AM
0 votes
1 answers
197 views
Can an Automator workflow generate an Application?
I'm building a "Wizard" of sorts that uses Automator and some Appliescript, and at the end I would like it to generate an "Automator Application" that does things when launched, that are based on the inputs from the wizard. Is this even possible? Can one Automator workflow, actually generate an appl...
I'm building a "Wizard" of sorts that uses Automator and some Appliescript, and at the end I would like it to generate an "Automator Application" that does things when launched, that are based on the inputs from the wizard. Is this even possible? Can one Automator workflow, actually generate an application from the results? I know software can create software, but is this possible within Automator's capabilities? **EDIT: As noted in the comments below the post, osacompile seems like it might get me where I want to go, but now I have a new problem with that.** Here's a screenshot of my automator steps: Automator routine Here's the code of the erroring module (Send iMessage): on run {input, parameters} set sms_address to item 1 of input set email_address to item 2 of input set sms_content to item 3 of input set email_subject to item 4 of input set email_body to item 5 of input set savePath to (path to desktop as text) & "test.scpt" set code to "osacompile -e 'tell application \"Messages\"' -e ' set imessageservice to 1st service whose service type = iMessage' -e ' set iMessageBuddy to buddy " & sms_address & " of imessageservice' -e ' send " & sms_content & " to iMessageBuddy' -e ' end tell' -o " & quoted form of POSIX path of savePath do shell script code return input end run Note that the lines are broken up that way because it was the only approach I could find where I didn't get any errors just because of adding line breaks (I can put this code all on one line and get the identical error) Here's the error I receive: osacompile error message I haven't been able to figure out what the problem is here but it seems like I'm not passing the variables in the way a bash script expects. Have tried a bunch of other approaches and nothing has worked any better, but this is the one that seems the most sensible to me, knowing how I would normally pass variables into a script. **EDIT 2: To simplify further, here is the standalone code I'm current debugging in AppleScript Editor and without any line breaks to not confuse the issue:** set sms_address to "person@gmail.com" set sms_content to "sms content" set savePath to (path to desktop as text) & "test.scpt" set code to "osacompile -e 'tell application \"Messages\"' -e ' set imessageservice to 1st service whose service type = iMessage' -e 'set iMessageBuddy to buddy " & sms_address & " of imessageservice' -e 'send " & sms_content & " to iMessageBuddy' -e 'end tell' -o " & quoted form of POSIX path of savePath do shell script code
JVC (2951 rep)
Jul 14, 2020, 11:41 PM • Last activity: Jul 21, 2025, 12:00 PM
0 votes
0 answers
30 views
Calling an Automator Workflow inside Visual Studio Code
I have a shortcut for an Automator Workflow that runs a python file on a selected text. That is, I highlight a text say "\(\alpha\)" then press Cmd+Shift+U and it automatically replaces the highlighted string "\(\alpha\)" to its unicode counterpart "α". This shortcut works perfectly when I use it on...
I have a shortcut for an Automator Workflow that runs a python file on a selected text. That is, I highlight a text say "\(\alpha\)" then press Cmd+Shift+U and it automatically replaces the highlighted string "\(\alpha\)" to its unicode counterpart "α". This shortcut works perfectly when I use it on most applications: For example, if I write "\(\alpha\)" in the address bar in Safari and use this shortcut, it works perfectly. However, I am unable to use it in Visual Studio Code. I have selected the "any application" toggle in Automator Workflow so I don't think that is the issue. In fact, rarely but sometimes, the shortcut works perfectly in Visual Studio Code on its own but I am not able to get it run consistently. How can I get the Automator Workflow to receive input from Visual Studio Code?
newbie (101 rep)
Jul 20, 2025, 04:41 PM • Last activity: Jul 21, 2025, 11:52 AM
1 votes
1 answers
133 views
My automated "click" Applescript has just stopped working
Right up until a week ago, my simple Applescript that had to simply click on a specific coordinate on screen just stopped working. Here is the Applescript: tell application "System Events" click at {693, 619} end tell And I automate it's trigger at a specific time of day with the help of osascript (...
Right up until a week ago, my simple Applescript that had to simply click on a specific coordinate on screen just stopped working. Here is the Applescript: tell application "System Events" click at {693, 619} end tell And I automate it's trigger at a specific time of day with the help of osascript (recommended for Applescripts) using the following plist file. Label com.mouseclick.plist ProgramArguments /usr/bin/osascript /Users/mugenvoid/Downloads/mouseclick.scpt StartCalendarInterval Hour 6 Minute 10 I've added this plist file to the LaunchDaemons folder of my core Library folder. This will ensure it's a global daemon, so it should have the highest chance of always triggering correctly. Beyond that, I've given all the relevant access and permissions (Accessibility, Automation, disk access etc) for this setup to work correctly. To ensure the job is loaded correctly and functional, I use an application called Launchcontrol 2. Over there, it is always loaded in correctly and the status shows as OK. Despite all these checks and balances, the script just doesn't click on the specific coordinate no more. It was always working perfectly fine up until a week ago and I haven't made any changes whatsoever to this whole setup. The Launchcontrol 2 application has some launchd(8) logs of the job trigger event at the designated time that I would like to share. Perhaps it will help with the debugging. Here it is: 2024-10-22 06:10:03.808584 internal event: WILL_SPAWN, code = 0 2024-10-22 06:10:03.808688 service state: spawn scheduled 2024-10-22 06:10:03.808692 service state: spawning 2024-10-22 06:10:03.808727 launching: xpc event 2024-10-22 06:10:03.810543 xpcproxy spawned with pid 28683 2024-10-22 06:10:03.810593 internal event: SPAWNED, code = 0 2024-10-22 06:10:03.810599 service state: xpcproxy 2024-10-22 06:10:03.810718 internal event: SOURCE_ATTACH, code = 0 2024-10-22 06:10:03.827675 service state: running 2024-10-22 06:10:03.827703 internal event: INIT, code = 0 2024-10-22 06:10:03.827709 job state = running 2024-10-22 06:10:03.827726 Successfully spawned osascript because xpc event 2024-10-22 06:10:10.104597 exited due to exit(0), ran for 6293ms 2024-10-22 06:10:10.104617 service state: exited 2024-10-22 06:10:10.104630 internal event: EXITED, code = 0 2024-10-22 06:10:10.104633 job state = exited 2024-10-22 06:10:10.104665 service inactive: com.mouseclick.plist 2024-10-22 06:10:10.104681 service state: not running To the best of my knowledge, I've checked everything possible from my end and am still faced with this roadblock. I'd really appreciate your support here! Condensed view of what I've tried so far: - Under the Privacy & Security settings section, I enabled Accessibility for osascript, launchcontrol and the script editors I've used for the Applescript and the plist file. See image attached below. Accessibility Settings - Under the Privacy & Security settings section, under Automation, the requisite access has been given to Osascript and relevant applications. See image attached below. Automation Settings - Ensured the job is loaded correctly with no errors and that it is loaded in as a global daemon (by adding the plist file to the LaunchDaemons foler in my core Library folder). See image attached below. Launchcontrol 2 job view - Verified the script file and plist file and found no syntax errors (code used for both has been shared above). - Ran the script file from the Script Editor itself to confirm if it's working fine and got the following results. See image attached below. Script run results
Anshu Chang (21 rep)
Oct 22, 2024, 07:41 AM • Last activity: Jul 21, 2025, 03:02 AM
2 votes
1 answers
82 views
Keyboard shortcut to run Automator service not working in Emacs
I have an Automator service set up to run an application, and I've bound this to a keyboard shortcut (process described at [Create global shortcut to run command line applications](https://apple.stackexchange.com/a/40887) and [Keyboard shortcut (almost) never works for Automator service](https://app...
I have an Automator service set up to run an application, and I've bound this to a keyboard shortcut (process described at [Create global shortcut to run command line applications](https://apple.stackexchange.com/a/40887) and [Keyboard shortcut (almost) never works for Automator service](https://apple.stackexchange.com/a/360179)) . This works in the Automator app during testing, and it works on most applications. However, in Emacs, the shortcut is being captured by the application, so the workflow is not being performed (s-\ is undefined). I have added accessibility to Automator/Finder, but this did not fix the issue. The keyboard shortcut I am hoping to use is Cmd+\\, however I have tried [different](https://apple.stackexchange.com/a/135616) [combinations](https://apple.stackexchange.com/a/337176) (with and without ⌘; Emacs is capturing everything). It seems like I somehow need to set the priority of this keybinding to work regardless of the application that is currently selected. How can I do this? ![Screenshot of an Automator window to run a shell script ][1]
Jake Ireland (218 rep)
Oct 23, 2023, 06:58 AM • Last activity: Jul 19, 2025, 10:02 AM
2 votes
1 answers
199 views
Can Automator be used to visit/upload/save images from a website?
I have a folder on desktop with png images. I'd like the images to be sent to a website (Vectoriser.ai). Uploaded one image at a time (multi drop is not available) and save the result to another folder on desktop. The website process is four steps, upload/press ok/press download/press another downlo...
I have a folder on desktop with png images. I'd like the images to be sent to a website (Vectoriser.ai). Uploaded one image at a time (multi drop is not available) and save the result to another folder on desktop. The website process is four steps, upload/press ok/press download/press another download button. I couldn't find anything in the search results that match my requirements exactly, so I'm wondering can this even be done? I'm using an old iMac 2011 High Sierra 10.13.6
Bow (21 rep)
Oct 25, 2023, 11:21 AM • Last activity: Jul 17, 2025, 03:04 AM
0 votes
1 answers
37 views
Need assistance debugging an Apple Script for duplicating iCloud Calendar items not older than 30 days to a specific Outlook calendar
I have been creating an Apple Script that duplicates calendar items from our shared Family iCloud calendar to a work-related Outlook calendar with the same name (different email address). The following script has been iteratively generated with ChatGPT but it has at least 1 syntax error that I can't...
I have been creating an Apple Script that duplicates calendar items from our shared Family iCloud calendar to a work-related Outlook calendar with the same name (different email address). The following script has been iteratively generated with ChatGPT but it has at least 1 syntax error that I can't fix, relating to the apparently non-existent occurrence property of a Calendar.app event in the following line:
-- NOTE: the following line yields a syntax error "Expected class name but found identifier."
set occurrencesList to every occurrence of thisEvent
Can somebody help me out with this script?
-- Path to a file where we store the event UIDs
set uidFilePath to "~/Documents/icloud_event_uids.txt"

-- Create or read the list of already processed event UIDs
set uidFile to open for access (POSIX path of uidFilePath) with write permission
try
    set processedUIDs to read uidFile as text
on error
    -- If file does not exist, create an empty list
    set processedUIDs to ""
end try

tell application "Calendar"
    -- Select the iCloud calendar
    set sourceCalendar to calendar "Family" -- Replace "iCloud" with the actual calendar name if needed
    set eventList to every event of sourceCalendar
    
    -- Access Outlook application
    tell application "Microsoft Outlook"
        -- Select the Outlook calendar (replace with the name of your desired calendar)
        set targetCalendar to calendar "Calendar" -- Replace "Calendar" with the name of your Outlook calendar
        
        -- Get the current date for comparison
        set currentDate to current date
        set thirtyDaysAgo to currentDate - (30 * days)
        
        -- Normalize currentDate and thirtyDaysAgo to UTC
        set currentDateUTC to convertToUTC(currentDate)
        set thirtyDaysAgoUTC to convertToUTC(thirtyDaysAgo)
        
        -- Check for events older than 30 days in Outlook and remove them
        set outlookEventList to every calendar event of targetCalendar
        repeat with outlookEvent in outlookEventList
            set eventEnd to end time of outlookEvent
            set eventEndUTC to convertToUTC(eventEnd)
            if eventEndUTC < thirtyDaysAgoUTC then
                -- Remove event if its end time is older than 30 days
                delete outlookEvent
                -- Remove the UID of the deleted event from the processed list
                set eventUID to subject of outlookEvent -- Use the subject or another unique property to track this
                set processedUIDs to removeUID(eventUID, processedUIDs)
            end if
        end repeat
        
        repeat with thisEvent in eventList
            -- Get the start time, end time, summary, and UID of the iCloud event
            set eventStart to start date of thisEvent
            set eventEnd to end date of thisEvent
            set eventSummary to summary of thisEvent
            set eventLocation to location of thisEvent
            set eventDescription to description of thisEvent
            set eventUID to id of thisEvent -- iCloud unique identifier (UID)
            
            -- Normalize event start and end times to UTC
            set eventStartUTC to convertToUTC(eventStart)
            set eventEndUTC to convertToUTC(eventEnd)
            
            -- Check if the event UID has already been processed
            if eventUID is not in processedUIDs then
                -- Process this event (e.g., duplicate it into Outlook)
                
                -- Check if it's a recurring event
                if recurrence of thisEvent is not missing value then
                    -- Handle recurring event by extracting all occurrences
                    set recurrenceRule to recurrence of thisEvent
					-- NOTE: the following line yields a syntax error "Expected class name but found identifier."
                    set occurrencesList to every occurrence of thisEvent
                    
                    repeat with occurrence in occurrencesList
                        -- Get start and end time for each occurrence
                        set occurrenceStart to start date of occurrence
                        set occurrenceEnd to end date of occurrence
                        
                        -- Normalize occurrence start and end times to UTC
                        set occurrenceStartUTC to convertToUTC(occurrenceStart)
                        set occurrenceEndUTC to convertToUTC(occurrenceEnd)
                        
                        -- Check if the occurrence already exists in Outlook
                        set eventExists to false
                        set outlookEventList to every calendar event of targetCalendar
                        repeat with outlookEvent in outlookEventList
                            set outlookEventStart to start time of outlookEvent
                            set outlookEventStartUTC to convertToUTC(outlookEventStart)
                            if (outlookEventStartUTC is occurrenceStartUTC) and (subject of outlookEvent is eventSummary) then
                                set eventExists to true
                                exit repeat
                            end if
                        end repeat
                        
                        -- If the occurrence does not exist, create it
                        if eventExists is false then
                            make new calendar event at targetCalendar with properties {subject:eventSummary, start time:occurrenceStart, end time:occurrenceEnd, location:eventLocation, content:eventDescription}
                        end if
                    end repeat
                else
                    -- If it's a single (non-recurring) event, process as usual
                    set eventExists to false
                    set outlookEventList to every calendar event of targetCalendar
                    repeat with outlookEvent in outlookEventList
                        set outlookEventStart to start time of outlookEvent
                        set outlookEventStartUTC to convertToUTC(outlookEventStart)
                        if (outlookEventStartUTC is eventStartUTC) and (subject of outlookEvent is eventSummary) then
                            set eventExists to true
                            exit repeat
                        end if
                    end repeat
                    
                    -- If the event does not exist, create it
                    if eventExists is false then
                        make new calendar event at targetCalendar with properties {subject:eventSummary, start time:eventStart, end time:eventEnd, location:eventLocation, content:eventDescription}
                    end if
                end if
                
                -- Append this event UID to the list of processed UIDs
                set processedUIDs to processedUIDs & eventUID & linefeed
                write processedUIDs to uidFile
            end if
        end repeat
    end tell
end tell

-- Close the file after processing
close access uidFile

-- Function to remove UID from the processed list
on removeUID(thisUID, uidList)
    set textItemDelimiters to linefeed
    set uidListItems to every text item of uidList
    set newUIDList to {}
    
    repeat with currentUID in uidListItems
        if currentUID is not thisUID then
            set end of newUIDList to currentUID
        end if
    end repeat
    
    return (newUIDList as text)
end removeUID

-- Function to convert date to UTC
on convertToUTC(inputDate)
    set timeZoneOffset to (time zone of (current date)) -- Get the current time zone offset
    set utcDate to inputDate - timeZoneOffset -- Convert to UTC by subtracting the offset
    return utcDate
end convertToUTC
ShutterFreak (326 rep)
Feb 11, 2025, 10:14 PM • Last activity: Jul 13, 2025, 09:07 PM
1 votes
1 answers
515 views
Automator application script not working when scheduled from "not on the screen" user
I have an Automator script (app) that simply does few clicks in an app. This script is launched via a calendar event. The script is scheduled and run from a different admin account than the account that is "physically" opened on the computer screen. Here is how it goes : when I test the script while...
I have an Automator script (app) that simply does few clicks in an app. This script is launched via a calendar event. The script is scheduled and run from a different admin account than the account that is "physically" opened on the computer screen. Here is how it goes : when I test the script while connected with Screen Sharing, the script run just fine. But if I leave the Screen Sharing app (the user session should still be running in background), the script return an error when launched by the calendar event **"Watch me do error : (OSStatus error -50)"**. If I do the same, but I schedule the script from the other admin account (the one "physically" opened on the computer screen), it runs fine. I already set the permissions in Privacy settings to the script. It seems to be a problem of Automator script execution when runned on a "not on the screen" user account.
danydacosta (11 rep)
Oct 24, 2022, 09:21 AM • Last activity: Jul 10, 2025, 08:05 PM
1 votes
1 answers
106 views
Launch DMG drive script failing after restart
I have an automation (screenshots of it here: https://www.icloud.com/iclouddrive/0bB-1AiIWdJc1jmkfdjRbsAVA#Launch_Plex_Media_Automation_ )saved as an app in Automator with the following AppleScripts to mount an encrypted DMG file, enter the password in security agent pop up and click OK. macOS is Ca...
I have an automation (screenshots of it here: https://www.icloud.com/iclouddrive/0bB-1AiIWdJc1jmkfdjRbsAVA#Launch_Plex_Media_Automation_ )saved as an app in Automator with the following AppleScripts to mount an encrypted DMG file, enter the password in security agent pop up and click OK. macOS is Catalina. It worked wonderfully for two years. Then it stopped working. After several attempts to fix the script, I went into Time Machine and retrieved the script from a time I knew it was working. It worked great for a bit but now it works a few times then stops entering the password. If I run just the script from Script Editor, it works great. Same if run from Automator. It will continue working in the automation until I shut my MBP down, then it's back to waiting for me to manually enter the password again. The automation has full disk access. Suggestions to fix this please?
tell application "MountDMG"
	activate
end tell

delay 5

tell application "System Events"
	set value of text field 1 of window 1 of process "SecurityAgent" to "Password"
	click button 2 of window 1 of process "SecurityAgent"
	--> button "OK" of window 1 of application process "SecurityAgent"
end tell
Gregg Potocnik (61 rep)
Jun 25, 2021, 10:45 PM • Last activity: Jul 10, 2025, 05:08 PM
3 votes
1 answers
685 views
USB Overdrive how to use a modifier key to change the macro executed
On my Mac I use USB Overdrive to assign the macros Cmd Shift [ or ] to switch tabs quickly with my mouse's side buttons. I wanted to know if it was possible to make it so that when I am holding down a certain key e.g. Shift and then press these side buttons I can have it execute a different macro th...
On my Mac I use USB Overdrive to assign the macros CmdShift[ or ] to switch tabs quickly with my mouse's side buttons. I wanted to know if it was possible to make it so that when I am holding down a certain key e.g. Shift and then press these side buttons I can have it execute a different macro than when Shift isn't held down? Basically, I want to be able to use the side buttons to either switch between tabs or go forward/backward depending on if I'm holding down Shift.
Colby Wright (31 rep)
Jan 31, 2023, 05:30 AM • Last activity: Jul 8, 2025, 08:03 AM
1 votes
2 answers
38 views
Automating multiple global replace in TextEdit?
For language learning, I frequently copy text from a website, paste into TextEdit, and do more than a dozen formatting changes.&#160; Several of these are the same for all languages, so I save the file, do those changes with perl in a script, then open it again for manual edits. **If possible, is th...
For language learning, I frequently copy text from a website, paste into TextEdit, and do more than a dozen formatting changes.  Several of these are the same for all languages, so I save the file, do those changes with perl in a script, then open it again for manual edits. **If possible, is there a way to run a script on the contents of a TextEdit window?** A partial (awkward) solution is to save the file without closing the window, in Terminal, run the script and cat the result, then the TextEdit window, Cmnd-A and paste the result into to replace.
WGroleau (5370 rep)
Jul 3, 2025, 03:17 PM • Last activity: Jul 4, 2025, 04:05 AM
0 votes
1 answers
409 views
How to add version to an Automator service workflow
I have a workflow which is installed as a Service. It is used to call code in my AppleScript applet. The Service has one action: a "Run AppleScript" action. I update the Service quite often with improvements. I need a way to know that the installed version of my Service is old. One way might be to g...
I have a workflow which is installed as a Service. It is used to call code in my AppleScript applet. The Service has one action: a "Run AppleScript" action. I update the Service quite often with improvements. I need a way to know that the installed version of my Service is old. One way might be to give it a "version". I have tried many ways, none of which worked. In particular, usually there is a CFShortVersionString key in an app's info.plist file. I can add that to my Service's info.plist file. But, when I open my Service in Automator.app, make some changes and then save, all my custom entries in the info.plist file are deleted. Is there an editor for Automator workflows that does not remove custom keys in the info.plist file ? Thanks. UDATE: Adding a variable to the workflow is a good idea. But, I can't it working for me. Yesterday, I added the variable called "Version" and gave it a value "1.21". Today, the variable is still there but is empty. Probably because I still do not understand how it all works and I made a mess of it. In the end, a separate file in the service's bundle containing just the version string is easy for me as my AppleScript applet can read it without having to parse a complicated XML file (either as plain text or using System Events). Also, I still don't know how developers create workflows which DO contain version and other keys inside the info.plist file. Automator removes those keys and so developers must be using another tool – Xcode ? Have also found some services that contain a "version.plist" file. I have Googled for hours but, can find no documentation on the "version.plist" file content – which seems to duplicate some keys inside info.plist. The "version.plist" file does not seem to be used by Finder. In an example service provided by Apple, if I delete the CFBundleShortVersionString from the info.plist file, but retain the version.plist file, Finder's Get Info shows no version. UPDATE 2: Apparently version.plist is used by Installer. More detail here: http://mirror.informatimago.com/next/developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution/Concepts/sd_pkg_version_info.html Can't find that detail anywhere on developer.apple.com so, it might be out-of-date/wrong.
Garry (21 rep)
Feb 10, 2022, 01:12 AM • Last activity: Jun 30, 2025, 09:01 AM
1 votes
1 answers
290 views
Batch Change Created Date using Automator and CSV File
I have 1,500-some Facebook photos all showing with the same date as they come from a data download. Through the magic of regular expressions, I have generated a TSV file where each row has the filename on the left and the correct timestamp on the right, example being: `13170030_982552864458_69609533...
I have 1,500-some Facebook photos all showing with the same date as they come from a data download. Through the magic of regular expressions, I have generated a TSV file where each row has the filename on the left and the correct timestamp on the right, example being: 13170030_982552864458_69609533_o_982552864458.jpg{tab}7/29/2017 4:47:23 PM How would I go about batch changing the taken/modified/created dates for these files in Automator or Shortcuts? I also have a Windows PC so if this isn't possible with MacOS but you know of a solution using Powershell or a COTS Windows product off-of-the-top-of-your-head, that's fine with me.
Phil Hobrla (111 rep)
Apr 14, 2022, 12:05 PM • Last activity: Jun 30, 2025, 07:04 AM
1 votes
1 answers
1261 views
Use Automator to move files to new folder based on list of filenames?
I'm not sure if this is something that Automator can do, and would really appreciate any pointers. I'm working with a folder of ~4500 images. Based on some metadata that I have from another source, I want to move about a thousand of those images to a new folder (it's just too many to move by hand)....
I'm not sure if this is something that Automator can do, and would really appreciate any pointers. I'm working with a folder of ~4500 images. Based on some metadata that I have from another source, I want to move about a thousand of those images to a new folder (it's just too many to move by hand). I have a csv file that includes the names of the files to move, but I can't figure out how to get Automator to let me set the list as a criteria. The filenames are all randomly assigned strings of 32 numbers and letters, so I don't think this is a matter of filtering. How would I go about moving ~1000 files from one folder to another using a csv/list? Maybe it's possible that Applescript is a good option, but I can't say I've ever looked there at all, so I'd be starting from scratch.
jcc (19 rep)
Oct 12, 2021, 07:26 PM • Last activity: Jun 26, 2025, 04:07 AM
1 votes
2 answers
742 views
Mac Automator: combine images in PDF and resize
I not too familiar with Automator for Mac. I am trying to create a quick action to combine several images in a single PDF file and reduce its size with a quartz filter. The actions does indeed create the pdf but it does not reduce its file size. This is what I did: [![enter image description here][1...
I not too familiar with Automator for Mac. I am trying to create a quick action to combine several images in a single PDF file and reduce its size with a quartz filter. The actions does indeed create the pdf but it does not reduce its file size. This is what I did: enter image description here If I create two separate quick actions (one to create the pdf from images and another one to reduce the size of a pdf file) and apply them sequentially they work correctly. But not combined into a single action. What am I doing wrong?
kalka (21 rep)
Feb 12, 2021, 12:17 PM • Last activity: Jun 23, 2025, 08:08 AM
Showing page 1 of 20 total questions