Questions tagged [applescript]

AppleScript is a proprietary programming language in macOS to control and exchange data with applications.

380 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
360 views

OSX Flush DNS without sudo

I have a Mac that keeps messing up its DNS (this may be a wider network issue, we have windows clients that are having problems too). Whilst I try to understand the DNS issue I'd like to set an 'icon' ...
1
vote
0answers
405 views

Clean up of calendar event before/during duplication

This issue all stems from duplicating events from subscribed calendars to a single iCloud calendar I share with someone. When the origin calendar is well structured everything works as expected. My ...
1
vote
0answers
1k views

How to: Automator, launch an app, as if I dragged n dropped file on App's dock icon?

Using automator, I know how to "Launch an App". I would like to know how to "Launch an App in a specific way". The app I want to launch, acts differently depending how its launched. If one: clicks ...
1
vote
0answers
44 views

Forcing application to go to selected window on startup

I run a multi-monitor set-up on a single "Desktop". All of my applications when opened run on the primary monitor, which is the smaller monitor. I would like to have some (e.g. browser, mail client) ...
1
vote
0answers
677 views

Automount afp Volume with AppleScript

I know this is similar to other open questions about mounting network drives, but this one is slightly different. I have an AppleScript that runs at startup that looks like this: tell Application "...
1
vote
0answers
73 views

Filling areas of Json script with user prompts

I am wanting and Applescript to fill certain parts of a Json script via user input prompts, but not sure how to place the results in the correct areas? And to then have the result copied to the ...
1
vote
0answers
476 views

How to execute javascript from an applescript (Yosemite)?

Since Yosemite, the Script Editor allows using javascript. What is the best way to execute javascript from an applescript? My use case is an existing applescript which needs to send some parameters ...
1
vote
0answers
1k views

Add local file URL handling to Applescript Application

I am using a simple applescript application to open different URL schemes in different Fluid Apps. By setting this app as the default browser, I can effectively parse out the URL scheme and open the ...
1
vote
0answers
1k views

AppleScript auto Email attachment save

I am looking for an AppleScript, that simply uses an email defined by the "Mail Rules" and extracts the attachment to a specific folder. I found different codes, but they all didn’t do want I want. I ...
1
vote
0answers
1k views

Automator or Applescript for custom script to download bank statements?

What's the best tool to script to automate downloading statements from my bank and credit card companies' website in each of their statement download area? All banks, credit card companies, and ...
1
vote
0answers
134 views

Third party apps can't call applescript that otherwise work in 10.9

I am invoking my apple script from third party executable(C executable). Here is the applescript: on run argv do shell script ("open -n /Applications/Test.app/ --args " & "'" & item 1 ...
1
vote
0answers
62 views

Automatically reduce MacBook brightness on connecting to external display?

I would like my macbook to reduce its screen brightness to zero when I connect it to an external display. I know there's no such setting, but how would I go about writing a script that would do that? ...
1
vote
0answers
389 views

How to run an AppleScript whenever a VNC connection is established?

I want to run a script whenever any user connects remotely to my Mac. I've Googled a bit about it but no perfect tutorial is there. I am less comfortable working with OS X.
1
vote
0answers
163 views

How to prevent AppleScript confirmation from appearing when using Quicksilver trigger?

When I launch this simple AppleScript from Finder or by using the standard Quicksilver panel selection, it runs without confirmation. tell application "Flux" if it is running then quit ...
1
vote
0answers
1k views

Disable copy/paste for an OS X application

I would like to disable copy/paste for an app to protect sensitive information displayed in it. I don't have the app source code. I'm already aware of this general solution: https://superuser.com/...
1
vote
0answers
422 views

Script to make the x red button kill the app

Quick background: new mac, long time windows user; not scared by linux and scripts. I am currently using RedQuits to make the x red button quit de app, not just close the window. It is a great ...
1
vote
0answers
245 views

Can I find and replace Core Text/Cocoa text strings in any application?

My scenario: I use an app called Antetype for UI design. Antetype uses OS X-native technologies for text rendering (it uses the system-standard text palette). Antetype does not have a find and ...
1
vote
0answers
1k views

Can a new mail be sent using AppleScript + Outlook + IMAP?

I'm trying to use apple script to automate creation of a new outlook mail message. The below code will work when I have my email account sent up as pop3 but I need it to work with an IMAP account. ...
1
vote
0answers
192 views

Touching files in correct order

This code touches files in alphabetical order. I need to touch files in order it is in list_of_files, so first it touches file2, then file3, then file1). Is there any other way to do this than to ...
1
vote
0answers
824 views

How do I tell Finder to read the network folder contents?

I use the following AppleScript script to automatically connect a remote drive when my VPN connection is established using Viscosity: do shell script "sleep 5" tell application "Finder" mount ...
1
vote
1answer
354 views

Apple Script: 'activate' an application in fullscreen

Im trying to run tell application "X" to activate on an application that is running in fullscreen, but its not working. Any ideas on how I can work around this and give focus to a running app in ...
1
vote
1answer
60 views

Count pages in a folder full of .doc files

I recently found this very helpful link to count the pages in a large folder full of PDF files: Count pages in PDF (for non-technical, mac using person). It worked like a dream. Now, however, I need ...
1
vote
1answer
372 views

Is there a hook for triggering scripts when a particular notification is displayed?

I'm trying to set up some system behaviors to occur when particular iCal or GCal events begin and end. Is there a way to hook into the notifications system (e.g., via a LaunchAgent) to make the Mac ...
1
vote
1answer
427 views

How can I control the Terminal in the current space with AppleScript?

Working on building a Handler that passes the terminal window then calls the ID for a script I've run into mixed results and I'm curious if there is a cleaner way to get window 1 The handler: on ...
0
votes
3answers
31 views

Leaving the last 9 characters of a filename in Automator

I have a ton of files to rename where we only need the last 9 characters of the file. The files are currently named as this: FirstName_LastName_000000000.pdf. Essentially, I want to rename the files ...
0
votes
0answers
10 views

AppleScript adding email content to Excel

I'm trying to use the script created by Tim Vaughan and posted on this page. The problem im having is that his format is: Name: XXXX and mine is: Name: XXXX code is --APPLESCRIPT _main() on _main() ...
0
votes
0answers
18 views

Use AppleScript to move (not copy) GMail message in Apple Mail

How do I get AppleScript to appear to move (but not copy) a Gmail message in Apple Mail? If I use move theMessage to targetFolder the message appears in both folders. (More precisely, the message ...
0
votes
1answer
12 views

which certificate/identifiers/profilers should be used for python script to be distributed as a pyinstaller build/bundle outside the app store?

My program works as follows In a while loop, it checks for the active window change - AppKit library used from AppKit import NSWorkspace active_window = (NSWorkspace.sharedWorkspace()....
0
votes
0answers
18 views

Script to export all photos and album from Photos on Mac while keeping metadatas

My initial goal was to import "From my Mac" albums to my iPhone and keep them synced. It seems that an album created outside iOS is read only. And if I make a copy of it on my iPhone, it won'...
0
votes
0answers
11 views

Can I temporarily disable keyboard entries on the lock screen?

I'd like to create an apple script that sends the computer to the lock screen and disables the keyboard for 60 seconds. This is what I have so far Lock the keyboard entries with KeyboardCleanTool Go ...
0
votes
1answer
41 views

Simple AppleScript script terminates early

I have an AppleScript script for Music that processes the selected tracks and modifies the track name. Basically, it works. If I select one item, it works without fail. If I select multiple items, it ...
0
votes
1answer
45 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, ...
0
votes
2answers
35 views

Calling AppleScript routine using osascript

Given the following AppleScript code on myHandler() display dialog ("I'm your Handler!") end myHandler How do I call myHandler from osascript (using Terminal), plain without parameters, ...
0
votes
0answers
15 views

How do I organize screenshot based on window in Mac?

I tried to write a custom service in Mac with Automator to organize screenshots based on the window that is screenshot-ed. For example, if I use dictionary app in Mac in a full screen mode, and do ...
0
votes
0answers
16 views

Knowledge Request- Automatically Log Out of Google Services Script

TL;DR- is there a way to set Gmail to automatically log itself out? I am in the process of distancing myself from Google's services, and while it is inevitable that one will always interact with ...
0
votes
0answers
25 views

How to change text in Xcode document via AppleScript

I'm currently working on an AppleScript to invoke ClangFormat while in Xcode 11.5. Here's the work-in-progress: set fpath to "" set selRange to {} tell application "Xcode" try ...
0
votes
0answers
14 views

Mail.app - compare two mailboxes?

I try to transfer 50 000 mails from an IMAP account A to another IMAP account B using Mail.app but it constantly fails during the process (that takes a day or so). There is a message-id-based ...
0
votes
0answers
39 views

How to use voice recognition with Apple Script

can someone help. tell application "SpeechRecognitionServer" set theResponse to listen for {"open (said application)", "who are you"} with prompt "Hello... I am ...
0
votes
0answers
74 views

com.automator.runner.xpc is not allowed to send keystrokes

I have two MacBooks. Both run the same MacOS version. I installed the same Automator script in both. But on the older MacBook I get: The action “Run AppleScript” encountered an error: “System Events ...
0
votes
0answers
12 views

Batch command to lock multiple files using Box Drive

My company uses Box.com and Box Drive to host collaborative files. Box gives the ability to lock files so multiple people can't work on them at the same time. With Box Drive I can right click ...
0
votes
0answers
14 views

Can I trigger an Apple Script event before my Google Calendar event ends?

I'd like to receive a notification whenever a meeting is within ten minutes of ending. I use Google Calendar, but I'm open to syncing my Google Calendar to Mac Calendar. Can I set a Growl ...
0
votes
1answer
45 views

Use Google speech to text instead of Apple's

Google currently has much higher quality speech transcription. You can try it easily by going to doc.new and pressing Cmd-Shift-S and talking. Compare to using the built in system from Apple (pressing ...
0
votes
1answer
36 views

How to move/hover mouse (not click) over a button on Safari by using Applescript

Can anybody tell me how to write an Applescript that can move or hover mouse over a Button on Safari? I've successfully made an Applescript that can click to the button but I don't know how to make ...
0
votes
0answers
11 views

How to get contents of most recent iMessage

I would like to get the contents of my most recent iMessage using either applescript of terminal. I'm fine with it going to the clipboard or a variable, but I can't find this information anywhere. ...
0
votes
0answers
18 views

Automating sorting process for files in a folder based on same prefixes in their filenames

Okay, I have a directory that is the output directory for generated screenshots for a media player I use on a macbook (OS X High Sierra). I take a multitude of screenshots to review video files and I ...
0
votes
0answers
15 views

Run an AppleScript remotely from another Mac or iOS device

I have an AppleScript on my Mac (which controls VLC and Airfoil to play internet radio through some Airplay devices) and I want to be able to run the script by doing a simple action, i.e. one or two ...
0
votes
1answer
20 views

Applescript voice control

I'm trying to create an app to toggle voice control on and off, as for some reason Catalina removed the link between dictation and voice control thus ridding itself of the ability to use a keyboard ...
0
votes
0answers
43 views

Using appleScript for remote auto login to macOS

I'd like to be able to log in my computer through Apple Remote Desktop (SSH) by running a script while the remote computer is running the loginWindow. An ideal script would automate the process of ...
0
votes
0answers
24 views

Applescript on Catalina

Total scripting novice here, appreciate any insight. Have a few scripts that automate button presses in a specific application, triggered by Function keys. Worked well before Catalina, now when ...
0
votes
0answers
5 views

View Homekit Sensor in Toolbar

I have some sensors that I would like to be able to glance at to see their values in the toolbar on my Mac. Is there a program or an API to let me do this?

1
4
5
6 7 8