Questions tagged [applescript]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

How do I use AppleScript to open the first note in a folder, in a different order than most recently edited?

This is a followup question to How do I use AppleScript to open a specific note from Apple's Notes application?. In that answer, the author is able to open the first note in a list based on time ...
0
votes
0answers
14 views

Applescript Javascript Music Radio Station

I am trying to get working in my AppleScript to show me the artist and name of song from the radio station that is playing. the code I have now works for regular music but just not the radio stations. ...
1
vote
1answer
24 views

Automator: combine images as PDF with useful file name

I have an Automator service (see below) which takes a folder of images and combines into a PDF. But I would like the name of the PDF to be based on the name of the first (or any) of the images. I.e., ...
-3
votes
2answers
69 views

How to get rid of phantom directories /Volumes on a Mac? [closed]

I have a couple of different problems with ls /Volumes. 1st, I have an AppleScript that could mount only 10 of my 13 volumes. The 3 I could not mount were named Data 1, Data 2, and Data 3. I renamed ...
0
votes
1answer
26 views

Script sort MP4 (and other) videos by orientation to portrait and landscape folders >>> IMPOSSIBLE?

I've been wrestling with a 14TB+ video library for the last months trying to dedupe and sort all of it into production ready folder structure. For the life of me I have not been able to find (spent 3 ...
0
votes
1answer
33 views

AppleScript and Music

I have created a small AppleScript that queries Music App if it is playing, and if it is then it queries and gets artist and song name. Now I want to query some more information. Where can I find the ...
0
votes
0answers
6 views

Applescript and keynote : change image z-order (send to back)

I want to generate a keynote presentation from a set of images. A few applescripts are around for that and work great - but: I cannot find a way to use AppleScript to arrange the z-order of shapes, i....
0
votes
0answers
23 views

Does “key code” command on applescript acts like a keyboard?

I'm running an applescript to automate some basic tasks on a third party software, I would like to know if the following code acts like a "real keyboard" for the third party software or if ...
1
vote
1answer
36 views

Problem with rsync in AppleScript

Im facing a problem with AppleScript/Rsync. I try to copy various folders from various drives to one HDD. The following shows a part of the Apple script which is more or less always the same part of ...
0
votes
1answer
33 views

What casues macOS sidebar to drop “favorites” (shortcuts to linked files/directories), other than macOS updates? How to prevent?

Every month or so my Macs drops all the favorites I have in the Finder windows (which also appear in Save/Open system dialogue windows). I takes time to redo them, and it is frustrating. I know that ...
0
votes
1answer
23 views

Choose only the first input file from input

I'm making an Automator App that will run an AppleScript. The app will be used for running a Terminal script on a file which the input receives - both by launching the app or by dropping a file on the ...
1
vote
0answers
23 views

applescript gives compile error on ui elements with blank in name like “ui elements” “pop up button”

When trying to do some UI scripting with applescript I found quite a few examples that use e.g. pop up button 1 of sheet 1 of window "somewindow" of application process "someprocess&...
0
votes
0answers
31 views

Can AppleScript be used to trigger a Quick Action (e. g. create PDF from selected files)?

The "Create PDF" Quick Action is much quicker and reliable than every other solution I have tested to create a single PDF from hundreds of images (.jpg or .png), be it Automator or a Python ...
1
vote
0answers
48 views

navigating Big Sur Battery pane w/AppleScript

Prior to Big Sur I used scripts to toggle the sleep function on my MacBook, for example: tell application "System Preferences" activate set current pane to pane "com.apple....
0
votes
0answers
12 views

How to handle click on notification triggered using Script Editor?

I am developing a simple script that triggers notifications using display notification. Once the script has been exported as an application using "Script Editor", I noticed that clicking on ...
2
votes
2answers
74 views

How to determine if all items in a list are the same

I'm currently in the works of an AppleScript calculator that extrapolates arithmetic linear sequences (sounds fancy but it really isn't). One of the processes it must go through is finding the common ...
0
votes
0answers
28 views

AppleScript can't access iCloud Drive

I'm new to this and playing with AppleScripts for the first time. The following script's outputPath keeps giving me the error "System Events got an error: NSArgumentsWrongScriptError" when ...
0
votes
0answers
14 views

AppleScript using JS to fill text field in safari

I'm trying to create a script to add domains in bulk inside CloudFlare team. Here is the draft (obviously I will replace theValue with a list) set theValue to "cdn.ss.anno.channel4.com" ...
-1
votes
1answer
59 views

AppleScript: Press “Q” every 1 second after idle for X amount of time in application “Roblox”

I am looking for a script that would press "Q" every second when idle for a certain amount of time in an application. I have never coded before and have several issues with code (below) that'...
0
votes
0answers
28 views

AppleScript counter

I used to use this AppleScript for incrementing a counter every time I was running the script, I tried to use again (from Keyboard maestro now) but the value remain to "1" no matter how many ...
0
votes
0answers
14 views

Click on link to open a terminal in a specific directory using iTerm

I want to use OmniOutliner to attach a directory to my outline. I think that the best way to do that is to have a link which, when clicked, opens iTerm in a specified directory. Can this be done? Mark
0
votes
2answers
24 views

AppleScript : Execute JavaScript on every Safari Tab/Window

How to run JavaScript in every safari TAB? I used to have a script with find a specific tab and run javascript but I have some issue and I was wondering how can I simply run some JavaScript in every ...
0
votes
2answers
68 views

Convert bulleted list HTML code to Markdown in AppleScript?

I have this text to manipulate in AppleScript (e.g. the text of a variable): Example note exported from Apple. <ul> <li>Indent</li> <ul> <li>*Further* indent</...
1
vote
1answer
41 views

Convert HTML hyperlink code to Markdown (MD) in pure AppleScript?

I have a text file or some text to process via the clipboard. It contains a few lines of HTML code, and I'd like to convert it to pure Markdown. E.g. from: This is a link: <a href="https://...
0
votes
0answers
47 views

iOS 14.1 default apps and widgets missing

I have just updated my iPhone to iOS 14.1 A number of default apps and widgets have gone missing. As example: No Weather app or widget. None of the 3rd part weather apps that I have paid for appear. ...
0
votes
1answer
47 views

Remove osascript starting after boot and get to know what it does

I am new to Mac and I have the following problem. After I log in after boot/restart, there is always a tab saying osascript wants to make changes which wants my password. I do not want to run this and ...
1
vote
0answers
18 views

Access text services via code

Is there a way to access text services such as these through either Applescript or terminal commands?
0
votes
0answers
19 views

AppleScript to for a Photo Album of last 90 days of photos?

I have a smart album in Photos of my last 90 days of photos. I want to have that be the screen saver on my Apple TV, but turns out you can only pick a static photo album, not a smart album. Is it ...
1
vote
1answer
42 views

Apple Automator: where does it store a new filename?

I have a line of code (that I can run successfully in Terminal) I'd like to incorporate into an Automator workflow but I can't work out how to reference the filename. I've set up my workflow as a ...
2
votes
0answers
11 views

Opening Track Output Window on pro tools using applescript

I am trying to create some Applescript lines to do some basic automation in pro tools and I was wondering if you guys can help out. I am trying to open the Track output window dialog but I can't seem ...
0
votes
1answer
32 views

Pages: can I change the document font size but retain the italics?

I've got a 500 page Pages ('09 v4.3 on OS X 10.12.6) document where all text is 14 point; I want to change to 12. The problem is that there are blocks of italic text throughout. Using Select all to ...
0
votes
1answer
17 views

Attach unique attachment to email using apple script to send email to different users

I'm new to apple script: Does anyone have an example of using an AppleScript to send individual emails with unique attachments for each email using an excel list? (Lots of examples out there sending ...
1
vote
1answer
28 views

AppleScript: set Safari tab to specific index

I have an AppleScript which search for tab and run a JS in the selected tab, It's work because of this : set current tab of w to t set index of w to 1 but I would like to improve the code so ...
-1
votes
1answer
39 views

Applescript fonction : «script» doesn’t understand the message

I have a script which work all the time when it's running outside a function tell application "System Events" tell process "theapp" set frontmost to true ...
2
votes
1answer
39 views

AppleScript call function in IF statement

I don't usually use function, but why can't I call a function inside an IF statement? for example this obviously work just fine notification() on notification() display notification "just a ...
1
vote
1answer
30 views

Automator AppleScript: Only Click Checkbox if Unchecked

I'm creating an Automator workflow to click the Enable This Account checkbox in the Contacts preferences pane. I used Watch Me Work in Automator to make most of it easy. The automation runs fine, but ...
1
vote
1answer
37 views

How to switch the keyboard input language from the terminal?

I already have one way to do this: function input-switch-darwin() { cliclick kd:ctrl kp:space ku:ctrl } But this is very slow: ❯ time cliclick kd:ctrl kp:space ku:ctrl cliclick kd:ctrl kp:space ...
2
votes
2answers
114 views

AppleScript to Rename File Names

Can anybody help me with the following issue. I'd like an AppleScript that will rename files like these by removing the leading numbers and underscore. So file names like these: 5111632_The Secret_ ...
0
votes
0answers
25 views

AppleScript copy file timing out

Hello guys I had a simple automator/script to copy one file to another folder, but since the last update of the system (I am using Mojave 10.14.6 with my MacPro), the action will always time out and ...
0
votes
1answer
98 views

AppleScript read and trigger other script base on received notification

Is they a way to read macOS Catalina notification from AppleScript? it's seems that they are not longer stored with ~/Library/Application Support/ , I'm not even sure of the process name, "...
0
votes
1answer
34 views

Mount Drive based on connection with if else statement (applescript)

can someone please help me out with this script. Where am I going wrong? Try set ping to (do shell script "ping -c 2 " 192.168.1.240) if ping contains "64 bytes" then tell ...
0
votes
0answers
22 views

Keyboard shortcut or script to move full screen applications to another screen

I have four physical displays and like using applications in full-screen mode. While working, I typically have around 10 apps running in full-screen. I frequently to rearrange the full-screen windows, ...
0
votes
1answer
60 views

Using Variables with AppleScript Action in Automator

Hoping someone can help me figure this out. I'm trying to build a Quick Action in Automator that copies three text values, stores them as variables, then pastes them when directed. Right now I built ...
0
votes
1answer
29 views

How do I launch Play-in-window from AppleScript

I'd like automatically launch Keynote's "Play->Play slideshow in window" feature. There's no predefined shortcut. Can that be done from AppleScript? How? Thanks.
1
vote
1answer
64 views

Automator script to click button on web page generates “The operation couldn’t be completed." error

The AppleScript below is supposed to click the first element with the magnifier class on a predefined web page. The script runs successfully if you comment out the JavaScript line, do JavaScript "...
1
vote
0answers
25 views

How to tell when Magic Keyboard or Trackpad are charging from bash

So I just registered and have not enough Kharma to comment on the original post (but I can ask a new question and this makes no sense to me; go figure), but I got this excellent script from Will Cain ...
1
vote
1answer
25 views

Automator service to look up words works with Latin characters but not Chinese characters

The following Automator script is supposed to open a Chrome tab and look up a Chinese word. The service opens the Chrome tab when Latin characters are chosen, but mysteriously fails to open a tab when ...
0
votes
0answers
43 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
0answers
12 views

How can I automate a key press with command and option keys involved on a MacBook? [duplicate]

I'd like to automate the simultaneous key press of command, option and "s" on my MacBook, but unfortunately, I don't know Apple Script well enough to programme this. Any suggestions? Thanks!
0
votes
1answer
112 views

Applescript Expected “"” but found unknown token

This is my code. I wanted to run an app (Game Capture HD) twice at the same time. But I get this Syntax Error: Expected “"” but found unknown token. Appreciate if anyone can fix it on run do ...

1
2 3 4 5
56