Questions tagged [applescript]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
575 views

Using osadecompile to get plain text AppleScript runs certain actions from the script

I've been using this solution to decompile AppleScript files before adding them to a Git repository. It basically creates a filter using osacompile and osadecompile to convert between plain text ...
0
votes
1answer
19 views

How to make an Apple Script use its local directory?

I am trying to bundle a .jar executable into an application using the solution provided here: How to create a .app folder from an executable .jar?. I deduced that main.script inside Contents -> ...
1
vote
1answer
168 views

AppleScript Error Message

I am looking for a way to batch-convert/bulk-convert .doc files into .docx files. I found this TidBITS Talk that references a Redit thread for an AppleScript (AS) and a dead DropBox link for an ...
0
votes
0answers
14 views

Data from a graph [closed]

I'm using AppleScript and I would like to know if there is a way to get values of a "graph"? The website is https://www.investing.com/currencies/eur-usd-chart??from=gyagbbb3 The values I'm ...
0
votes
1answer
33 views

How to execute pre-defined JavaScript function in AppleScript and pass data to JavaScript

In my AppleScript, I want to pass a list of keys to a website's client-side, then query the data on the backend, and get the response and re-render the client-side. All of these should happen in the ...
0
votes
1answer
29 views

How can I limit the number of results returned by an expensive filter expression in AppleScript?

In my Apple Notes automation on macOS Big Sur, I’d like to load any 5 notes whose name contains a substring. For example, if I know that I actually have 5 notes that match the query, I can write ...
0
votes
1answer
27 views

Stop Dictionary Pop-Up Window

< 3.5 GHz, 6-Core Mac Pro (2013 MacPro6,1) with 16GB RAM and D700 GPUs, running macOS 10.14.6 > Greetings, folks! After reinstalling MacOS 10.14.6, whenever I type cmd-control-d, a window pops ...
0
votes
1answer
62 views

How do I Employ CJK's AppleScript “makeASDate” Handler Without Error?

I am attempting to employ the makeASDate handler shared by user CJK (which I lifted from his answer at Apple Script: Can’t get date of "2018-12-12 10:00 AM") in order to set up some calendar ...
0
votes
2answers
51 views

Applescript to find word in text file

Mac, How do you use applescript to find a word in a text file and if there is that word then it will do something, but if there isn't then it will do something else?
0
votes
0answers
12 views

Apple script for toggling display mirroring [closed]

Could someone help me with an apple script to toggle Display Mirroring on/off?
0
votes
0answers
18 views

AppleScript // Retrieve data from a website to be stored in Numbers [closed]

I am writing to you because I am very (very) new to the use of AppleScript and its "programming". After many hours of unsuccessful research I would really like some help. I’ll explain you my ...
1
vote
3answers
1k views

How can you active the Script Menu Bar with AppleScript?

In AppleScript if you want to show the Script Menu in the menu bar you have to: Click Applications Scroll down and click Utilities Click Script Editor (this was called AppleScript Editor in older OS ...
0
votes
0answers
24 views

Big Sur 11.1: AppleScript to Automatically Change Wi-Fi Networks

So, like a user reported here on Stack Exchange, the built-in "networksetup" command in terminal is pretty unreliable at times. It's slow, and I've found for some reason dot1x never actually ...
2
votes
2answers
531 views

Apple Script: Can’t get date of “2018-12-12 10:00 AM”

Script Purpose The script below uses an App called Pashua to display a custom dialog box that returns multiple inputs. These inputs are then used to create a new Calendar event. The Issue The ...
1
vote
2answers
22 views

Notification when Apple compressor is done

I'm using the Apple compressor app from the command line to generate movies from sequences of images. This works fine, but the relevant command line command just exits before the job is done (while ...
2
votes
2answers
310 views

Automate the repositioning and refreshing of menu bar icons?

Background When menu bar items are rearranged manually using Cmd+drag, macOS writes a new "preferred position" preference to each app that is showing a menu bar icon. (This preference helps, ...
2
votes
0answers
125 views

Automatically accept Screen Sharing invitations?

I use Messages' Ask to Share Screen feature all the time to remotely debug problems on my contacts' Macs. It's a very easy way to initiate a Screen Sharing session, does not require port forwarding, ...
0
votes
1answer
15 views

Forward multiple emails?

I am using an online email parser. This selects specific text from an email and transfers it to an Excel spreadsheet which I shall use in CRM. I use Apple Mail and have 7000 emails in an account that ...
0
votes
0answers
27 views

Is it possible to skip an Automator action conditionally?

I have an automator application/workflow that takes a bunch of input from the user and spits out an application that performs some specific functions when run, based on that input. Basically I've ...
0
votes
1answer
30 views

How to automatically mount network share when iPhone backup screen is opened in Finder?

I would like to trigger a script that mounts a drive when I open the iPhone's device page in Finder (like shown here). Currently, I have the iPhone backups in an APFS volume, which is inside a ...
0
votes
1answer
40 views

Need help adjusting AppleScript automation for converting .pages to .docx?

How do I adjust this script to allow me to choose files not in a 'pages only' folder, and instead multiple "free" files? Keyword here is 'single'. I'm by no means a coding expert but I've ...
0
votes
3answers
90 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
27 views

How to run Applescript via bash from JAMF?

this apple script code works fine from the Script Editor app: tell application "Finder" to delete ((POSIX file "/Applications/Symantec Solutions/Symantec Endpoint Protection.app") ...
3
votes
1answer
449 views

Adding login items from terminal in Catalina

I've tried multiple ways but none work. A few AppleScripts and even some bash script somebody made. Which essentially just executes a different AppleScript afaik. Some of the commands I have tried: ...
8
votes
4answers
3k views

How to enable/disable grayscale mode in Accessibility via Terminal/App?

I'm wondering what would be the process of enabling/disabling the grayscale mode in the Accessibility panel in System Preferences? I would like to run a simple script, either by clicking on an app in ...
0
votes
0answers
30 views

New Outlook for Mac (v16.44) & Applescript

I am trying to migrate a number of AppleScripts to the new Outlook for Mac. A basic task is to retrieve selected messages. I have been using for years set msgSet to selection .. but this does not work ...
1
vote
2answers
517 views

Applescript : count Length

I created a code which count the length of a variable and take action regarding the length. It's work well except when I have a variable in this format : "00108030-00045C9E2638502E" 1: the count ...
1
vote
0answers
39 views

Multiple Desktops/Spaces: Assign specific application windows to a specific Space programmatically?

I have seen existing questions (Assign Application Windows to Different Spaces/Desktops, Spaces in Mavericks: apps do not remember their space, How to have certain *windows* start in different spaces ...
0
votes
1answer
34 views

Using automator or script to turn on wifi in case of ethernet cable failure, and vice versa?

For the moment, I have slightly faulty thunderbolt port on my 2013 mac book pro that I use to connect to the internet. My wifi works fine, but I prefer the increase in speed with the direct line. My ...
1
vote
1answer
38 views

How to automate Voice Control to manipulate the currently selected text?

Because I have limited use of my hands, I use Voice Control to dictate most of my text. (I'm using it to speak this question.) Voice Control offers the ability to add custom commands, including those ...
1
vote
1answer
29 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()....
2
votes
0answers
22 views

AppleScript Photos export quality

In AppleScript, I can export photos from Apple Photos. There are two options: using originals, which discards all modifications I've made not using originals, which exports them at 100% quality. The ...
2
votes
2answers
60 views

How do I pinpoint where the error is in Applescript?

Whenever I got an error from osascript, it looks like this: 698:699: syntax error: Expected end of line, etc. but found identifier. (-2741) How can I figure out where this error is (a general approach)...
0
votes
1answer
60 views

How to create a script with Automator to watermark each PDF in a folder with a different watermark?

I am trying to create a script to watermark a group a PDF files in a folder, each PDF has to have a unique watermark. All the PDFs are in one folder, all the watermarks are in .png located in another ...
1
vote
0answers
19 views

Auto-Clicker, with start / stop hot keys

I'm trying to recreate an AutoHotkey script that I use on my Windows machine. Here's a parsed down version of my AutoHotkey script and what it's meant to do: Set X to 1 If shift+G is pressed, set X ...
4
votes
4answers
733 views

Applescript - Code to solve the Daily Telegraph 'Safe Cracker' puzzle

I don't know if anyone is going to be interested in this (or if it the correct place to post it!). I spent a couple of hours trying to write a Script that would solve the 'Safe Cracker' puzzle from ...
3
votes
1answer
104 views

Use AppleScript to find the currently playing song (and other metadata)

The audio section of the touch bar can automatically detect which app is playing audio, and adds media controls to play/pause, skip, and seek through any audio. As an example, this works for Quicktime,...
6
votes
1answer
2k views

AppleScript to read all notifications in the Notification Center OSX 10.10 Yosemite

It seems like the following AppleScript is no longer working in the latest version of the OS X 10.10 (Yosemite): on run tell application "System Events" tell process "...
1
vote
1answer
18 views

Empty output when using some shell commands via AppleScript's “do shell script”

AppleScript allows you to run shell commands with do shell script. It's easy to assign a variable to an output of such command. set theResult to do shell script "echo everything" >> ...
0
votes
0answers
12 views

Pause and resume audio/video of application that registers with “Now Playing” widget

Often the pause key (middle key) of my headphone does not pause applications. I wonder if there is a command or applescript to pause and resume media playback for all GUI applications that shows their ...
0
votes
1answer
42 views

Service only application

I want to build a simple service that will allow me to keep any app window always on top or always on the same screen, when switching desktops. Is there a way to build a global MacOS service-only ...
5
votes
3answers
136 views

AppleScript app is not recognized as default browser

Target OS: Macos 10.15.3 Catalina Goal: use apple script bundled to app as a default web browser To debug I'm using very simple apple script, that just show passed url in dialog on open location ...
0
votes
1answer
55 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
33 views

Use the Finder to act on a path, via JXA

For a specific example, here’s how to change the name of a specific file via the Finder, in AppleScript: tell application "Finder" to set name of (POSIX file "/some/file/path" as ...
1
vote
2answers
60 views

Connecting AirPlay displays with a keystroke

I have an Apple TV in the living room. I have a Mac mini in my office. I have a wireless keyboard and mouse that can easily reach between the two locations, but am not willing to walk between them to ...
1
vote
1answer
31 views

How to use Applescript to type in a application?

I'm trying to type in another application using Applescript, and it keeps giving me this error: Can't get keystroke of "string". This is my code. on run {} tell application "My ...
0
votes
1answer
35 views

How can I get the width or height of the dock in Mac OS X so I can resize a window properly?

I want to write a code to resize a window by setting its bounds, and I need to consider where the dock is positioned and the size of the dock. I can get the dock's position and its size, but the ...
1
vote
1answer
44 views

Write cron script to open and exit application

I'm trying to write a script that opens a brand new instance of safari, displays a webpage for 10 minutes, then quits safari. I think I can follow this Stack Exchange to do steps 1 & 2 of my goal. ...
0
votes
0answers
39 views

Naming and switching windows

Let's say I want to dynamically assign an open window a number (or an alias) to be able to activate it quickly later. For example, say that I manually activate a Chrome Window that contains several ...
0
votes
1answer
46 views

Detect whether clipboard item is image data using AppleScript

This started because I wanted to be able to paste screenshots or pictures copied from Safari into Finder folders. Here are the steps to get to where I am: Install pngpaste using brew install pngpaste....

1
2 3 4 5
57