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
8 views

osa script to get user input with if condition

I want to run osa script to run in self-service application. first this line needs to be displayed: osascript 'tell app "System Events" to display dialog "Save and close all your files and ...
2
votes
2answers
59 views

How to write a text in Terminal using AppleScript?

How can I insert a text into Terminal.app using AppleScript? I don't mean to execute it (press Enter). Only to insert it. My current script almost works: tell application "Terminal" activate ...
1
vote
1answer
40 views

Running FFmpeg in Automator/AppleScript

I have written an apple script previously to automate a task I do in my work many times. With Apple updating to Catalina I will lose the use of Quicktime 7 (which is part of my Image sequencing ...
0
votes
0answers
21 views

Applescript service which utilises “on idle”?

I have been trying to run a script on a recurring basis via an apple service. Most answers I have seen have been are for 'stay-open' apps - whilst this possibly works as a solution and I have glanced ...
1
vote
2answers
23 views

How to Break up a Long Element List into multiple lines of code (Applescript)

In applescript, how do I make this a multi-line/easy-to-read property list? set props to {target:"Safari", slideNo:2, propsUrl:"https://docs.google.com/presentation/d/slideId/preview", rewardsUrl:"...
0
votes
1answer
26 views

Give assistive access to a single applescript

I have this script: #!/usr/bin/env osascript activate application "SystemUIServer" tell application "System Events" tell process "SystemUIServer" to keystroke "q" using {command down, control down} ...
0
votes
1answer
28 views

Applescript: Waiting till AFTER QuickTime Movie Recording Window is Active

I'm trying to resize a Quicktime Movie Recording Window--only after it's active. Is this possible? The below script does work––if I hardcode the delay time. Any help is appreciated. Thanks do ...
1
vote
1answer
38 views

Setting arrangement of new Finder Window via AppleScript

I want to create a new Finder Window, and change the default arrangement from "None" to "arrange by name". Here is my code that does everything except the arrange by name part: tell application "...
3
votes
6answers
163 views

Is it possible to script what applications should open certain file extensions?

I have a new Macbook Pro and I'm reminded that my development environment isn't tailored to what I setup on my previous Macbook. I was curious if it's possible to create a script in either AppleScript ...
0
votes
0answers
11 views

Applescript automating setting Security Config in Outlook365

I am attempting to automate setting up laptops. So far I've managed to script adding a new account with the correct parameters. Next is to select the SSL certificates that have been installed on the ...
1
vote
0answers
44 views

Apple Script with Terminal Commands

I'm trying to create an application that would automate a couple of Terminal commands. I need the application to open once I drop a file on top of it, run the commands, and close. The sequence of ...
-1
votes
2answers
24 views

Unminimize window Apple script not working when upgrading from El capitan to Mojave

I have an Apple script that I found somewhere that unminimizes windows. It worked on El Capitan but now it doesn't in Mojave. I assume there was a change of syntax but I know nothing about apple ...
0
votes
1answer
25 views

Automatically download software update over a specific network

I want my mac to automatically download updates for me only if I am connected to a specific WiFi network. Is this possible with a script? If so, how?
1
vote
0answers
37 views

Applescript to set terminal window to specific size

I found this question Is it possible to define the width/height of a Terminal window with this command: osascript -e \'tell application "Terminal" to do script and tried setting my ...
0
votes
1answer
32 views

AppleScript to connect Magic Mouse on iMac

I'd like to write an AppleScript that will connect my Magic Mouse 2. Basically, in words, I'd like a script that will show up in "Services" that opens system preferences, goes to Bluetooth, finds the ...
2
votes
2answers
60 views

OS X - build a bash function to send notifications via osascript / Applescript

Hoping some one can point out what I am doing wrong. After looking through several threads, plus lots of experimentation, it feels like something simple is wrong. The threads I read include How can I ...
1
vote
1answer
38 views

Help with AppleScript to automate Numbers Cell Formatting

I do several mundane repetitive tasks using Numbers App on a Mac, and wish I could just automate the same with the help of AppleScript. I got Numbers Spreadsheet with several tables, on the selected ...
1
vote
1answer
36 views

How do I stop an AppleScript script that is stuck in an endless loop without restarting my Mac?

I stupidly ran an AppleScript script on my Mac running macOS Mojave and the script is running in an endless loop. I thought something obvious like pressing the Esc key would end the program. However, ...
3
votes
2answers
31 views

Homebrew uninstalling fails

I am trying to uninstall a cask using homebrew, but each time it fails due to (I believe) AppleScript failing to run. I believe this issue stems from my multiuser setup (I am a non admin). Error: ...
5
votes
4answers
179 views

How to start an application when a specific disk is mounted

I store all my music on an external drive. I have iTunes set to start when I login. However, iTunes always starts before my encrypted drive has mounted, and so iTunes complains it can't find its ...
0
votes
0answers
45 views

Applescript how to choose file for all files or list of extensions

I have a cross platform project and need to do it in GoLang, but I do not have Mac. Could you provide correct syntax to the following? 1.Choose file for all file type? choose file with multiple ...
0
votes
1answer
32 views

AppleScript get filename from URL and apply Decode URL

I've got the following AppleScript that displays a notification once a download has been added: set yourpath to (the clipboard) as POSIX file set a to do shell script "basename " & quoted form of ...
0
votes
1answer
24 views

iphone 6 super duper hard [duplicate]

Why is my iphone 6 english in languange but on apple app store it is chinese?
2
votes
2answers
71 views

Can I use AppleScript to delete files on NAS listed in a file?

I am cleaning up my iTunes folders. I realized that there are more than 3k of files which are actually not in iTunes. I identified them and I have all of them inside a text file called "untitled.txt" ...
1
vote
1answer
74 views

Adding a line break to a shell output in AppleScript

I've got a script working but not the way I want. Here's the script return do shell script "BLUETOOTH_DEFAULTS=$(defaults read /Library/Preferences/com.apple.Bluetooth); SYSTEM_PROFILER=$(...
0
votes
1answer
68 views

Automate URL Redirection in Mac OS Automator

I would like some assistance to write an AppleScript to automatically redirect amazon.com to smile.amazon.com. I tend to always forget to use smile. With this automator I will never forget to. ...
1
vote
1answer
54 views

How to paste files using Applescript (or bash)?

I want to paste a file copied by Finder in the terminal. Sth like pbpaste but for binaries. (pbpaste itself just returns the basename of the copied file.)
0
votes
0answers
46 views

Getting Syntax Error “Can’t get every text item.” while creating new Service on Mac

I am getting the following syntax error while creating new Service on Mac while using below script, I have attached screenshot as well: "Can’t get every text item." on searchReplace(theText, ...
0
votes
1answer
60 views

applescript CURL with authentication fails

QUESTION: i need a working method to be used in applescript to get the right source of the page, WITHOUT loading the page. sample link: https://www.idealista.it/immobile/16679597/ result: wrong html,...
1
vote
0answers
32 views

Default Volume Slider in Quicktime Movie Recording

Is there any way to change the default volume for a Quicktime movie recording? If always defaults to 0 (muted) when starting a new movie recording. I understand that this is done in order to prevent ...
2
votes
1answer
64 views

Sort files by spreadsheet

I have a folder than contains over 1000 text files. The text files are supposed to be organised in folders. I have a spreadsheet which states which text file goes in which folder: Is there any way I ...
4
votes
1answer
45 views

PowerPoint Macro for Mac - load pictures like “Insert Photo Album”

PowerPoint on the Mac doesn't have the Insert Photo Album functionality which allows you to select images and new PPT created with one image on each slide. I have an old macro that does this on ...
1
vote
1answer
40 views

How can I stop AppleScript from converting variables like “\087” into their octal form when passing through bash?

I have a program I'm using to write xml with variables, and it passes through AppleScript and bash to form the final xml. However, one of my variables usually begins with "024", "054", or other three ...
0
votes
0answers
18 views

macbook pro starts up when asleep and not connected to power

I occasionally open up the bag I use to carry my macbook pro (running Mohave) and find the fan is running and the computer is hot. This is usually after a red eye. When I try to log into the ...
2
votes
1answer
50 views

How to interact with a Numbers sheet via AppleScript?

This question is related to: SUMIFS with comparisons to relative cells where I'm trying to figure out a way to do what I want using AppleScript. I've been searching the Web to find a way to set ...
1
vote
1answer
114 views

Auto Facetime call using Applescript, without confirm

I would like to automate a Facetime call without having to confirm the call in the Facetime app. Is there a way to do that? EDIT: when I execute the script I get this message in the upper right ...
0
votes
2answers
91 views

Disable Thunderbolt ports in macOS Mojave to mitigate the Thunderclap vulnerabilities

Due to the Thunderclap vulnerabilities we need to disable all Thunderbolt interfaces (except the DisplayPort signal). We are using Late 2015 iMac running macOS Mojave 10.14.5. Currently there is a ...
0
votes
0answers
24 views

How to make AppleScript ignore escape characters in string to make a Note

I have a python script that takes a user's input and inserts it into the name and body parameter of the make new note apple script. The problem is that any escape or special characters get interpreted ...
1
vote
1answer
115 views

Open url in new tab and paste the copied text

I'm new to AppleScript. I want to use AppleScript with Sci-hub page. In my scenario, I highlight DOI address -> AppleScript will open "Sci-hub.tw" page in new tab on Safari -> paste DOI address to ...
3
votes
1answer
53 views

How to copy URL with page title from Safari to Pages

In earlier versions of Safari and Pages drag&drop of an URL from Safari to Pages resulted in a link with the page title as the text, and the URL as a link "behind" it. It still works that way in ...
1
vote
3answers
108 views

Node Program Runs in Terminal, but Not As a “do shell script” AppleScript

I have a call (“mercury-parser” via Yarn, using the full path to the call) that converts Web pages to lines of structured text (the page used in the call describes the service): /Users/me/.yarn/bin/...
2
votes
1answer
56 views

Is it possible to query the current user's Apple ID from the command line?

Is it possible to query the current user's Apple ID from the command line? I want to create an AppleScript (run-only) app that will run only for a specific user (or at least for a user signed in with ...
0
votes
1answer
35 views

Keyboard shortcut for a service stopped working

I have made a custom keyboard shortcut for Finder that runs a script that copies the full file path to the clipboard. The shortcut is Control + Alt + Command + C. It has always worked, but today it ...
0
votes
2answers
42 views

How do I get Automator to move a folder to Appname.app/Contents/etc

I'm trying to create an Automator Quick Action to move a selected folder into the Resources folder of an app, accessed by clicking Show package contents in the Applications folder. There doesn't seem ...
2
votes
1answer
43 views

Automator and/or AppleScript to automatically Command-F2 to enter Target Display Mode

I'm trying to use Automator with AppleScript to automatically hit Command + F2 to enter Target Display Mode. The script runs but I just get a beep/tone with no action. I don't know if there's an error ...
-1
votes
1answer
61 views

How to script file for a Mac with several Terminal commands

I have few Terminal commands which i'm using so frequently,So i though to automate it to reduce the effort of copy-pasting the commands one by one in terminal and time. I created a .command file for ...
1
vote
1answer
42 views

MacBook Pro: Can't change the screen brightness

On my MacBook Pro 2012, I can't change the screen brightness. When I click on the brightness keyboard controls, nothing happens. Under System Preferences → Displays, the Brightness slider is missing: ...
0
votes
0answers
32 views

Distribute bash script 'silently' to multiple macos machines

We want to deploy a script 'silently' across all mac machines in organization. We have created a bash script that will run using launchd agent. We need to deploy the launchd agent and script on all ...
0
votes
1answer
34 views

error with automator applescript “do shell script” call (file not found) yet command line with same command works

I have a simple automator app that runs a simple script. It uses ssh to open a file on the local machine, MachineA, with an app on the remote machine, MachineB, and logs the ssh call. on run {input, ...
2
votes
1answer
124 views

Automatically open a terminal window and run a command, robustly

I am looking for a way to automatically open a new window of Terminal.app and run a command in it. I used to do this with AppleScript, in a way similar to this: tell application "Terminal" do ...