Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [applescript]

AppleScript is the Mac OS scripting language.

1
vote
3answers
32 views

OSX Command line Find Duplicate Filenames with different extensions

I've gone through all the similar questions + installed few command line utilities like duff but with no sucess. In my Images directory, I have images with same name but with different extensions (...
0
votes
0answers
13 views

How can I keep crontab automation work on macOS 10.14 after an user locked screen?

In macOS 10.13 I can just using crontab with AppleScript to turn my mac to an alarm with iTunes playlist. But it seems not working on 10.14, first there were new setting about automation in System ...
0
votes
0answers
15 views

Is there a way to programmatically open VSCode and then open the built-in terminal in VSCode on Mac?

I am trying to automate the process of opening VSCode and then opening its built-in terminal. I know I can open VSCode easily, but I don't know how I can communicate with VSCode once it is opened. Is ...
1
vote
1answer
10 views

AppleScript - filtering selection (Yojimbo)

I'm currently trying to filter a selection with Applescript. This works: tell application "Yojimbo" to set theYojimboSelection to selection but this does not:    tell application "Yojimbo" to set ...
0
votes
1answer
30 views

How to paste in safari with applescript without pasting in the actual applescript file

I recently discovered applescript and i have been eager to make an internet bot with it. I've built my bot with a memory so it doesn't search the same website twice. I want to keep my memory on google ...
0
votes
1answer
24 views

Applescript to restore foreground color doesn't work

When I attempt to restore a MacOS terminal window's default color by executing the following: osascript -e "tell application \"Terminal\" to set current settings of window 1 to settings set \"...
0
votes
1answer
24 views

Getting error number -1700 when trying to mount a network drive

I don't use AppleScript often but I wrote a short script to mount a network drive based on whether I am home or away: set SSID to do shell script "/System/Library/PrivateFrameworks/Apple80211....
2
votes
0answers
36 views

How can I determine what a read-only script does?

I have been given the task of fixing a series of automated tasks on multiple computers. One of the computers in this automated series is an old Mac running OSX 10.4. There are some scripts on this ...
4
votes
1answer
91 views

Alfred Workflow to move multiple files to Dropbox Folder

I am very new to AppleScript. I frequently share files from my local computer to Dropbox folder. For example: From: ~/Work/hello.txt To: ~/Dropbox/zzz_ShareMe/hello.txt cp ~/Work/hello.txt ~/...
0
votes
2answers
75 views

apple script handler not working in tell statement

Hi I am writing a script that will rename selected files / folders in the format xxxyearxxx to be xxxyear. I am new to apple script, have done plenty of autoit / c++ stuff. I can't get my handler to ...
0
votes
0answers
31 views

restore “com.apple.iChat”file,please

I delete"/Users/wangcl/Library/Application Scripts/com. apple. iChat" file before for a long time, And I really need it.Now my imessages cannot perform AppleScript processor, is there a way to restore?...
0
votes
3answers
221 views

Applescript how to open network window of Audio MIDI Setup

I'm trying to write an Applescript to create a network audio connection using the Audio MIDI Setup (/Applications/Utilities/Audio MIDI Setup.app). I'm not able to open the Network Setup window. There ...
0
votes
1answer
66 views

OSX File Renaming Issue

We have over 15000 images that need renaming. Is there a simple way to find text in a file name (from a csv file) and replace text in a file name (again from a csv file)?? Eg. File Name - AA021 ...
0
votes
0answers
18 views

Connect to VPN as long as application is running with AppleScript

I often need to connect to a VPN and start a remote desktop application on my MacBook. Using AppleScript (or Automator, if that works) I would like to combine those two actions: when I start the ...
2
votes
1answer
46 views

Moving two specific files into its parent folder within multiple directories with unique names

I need to move two specific files, we'll call them fileA.txt and fileB.sh into its parent folder. One of these files is generic but the other file is specific to its parent folder and can't be ...
0
votes
1answer
86 views

AppleScript - Advanced functions to improve steps / reduce code

I'm trying to reduce the number of steps and and increase performance for my applescript, I just wondered if there are some common functions I can employ. Here's an example script... tell ...
1
vote
1answer
132 views

AppleScript - How to Search result for a string?

I'm trying to search the result of an AppleScript to determine if a string appears. Running this code: tell application "System Events" to tell process "Box Sync" to ¬ tell menu bar item 1 of ...
-2
votes
2answers
70 views

Syntax error with (old?) open folder command

I'm working my way through AppleScript 1-2-3 (2009) and can't seem to run this example: tell application "Finder" close every window open home set toolbar visible of the front Finder ...
1
vote
2answers
139 views

Getting Unix path of multiple files/folders in Automator service

I want to get path of (multiple) file(s, folders) in Automator service by selecting them in Finder and then use them in shell command. I already have something like this: Launch AppleScript: on run ...
0
votes
0answers
32 views

How to count files using find command in external hard disk?

I am trying to get a count of files in various folders using Applescript and terminal. This works great on volumes on my main Macbook Pro: tell application "Finder" if exists window 1 then ...
0
votes
0answers
42 views

Send keystrokes to PID using Xcode

Hi Guys so I have an app on my desktop and want to send some keystrokes to it using xcode, I want to hit this app by the PID and not the name, also I want to send some keystrokes to it and make like ...
1
vote
2answers
82 views

Open Terminal with predefined tabs

Is there any way to open Terminal with predefined tabs? I have 5 most common paths that I usually use and I want Terminal to open with these paths opened in different Tabs. I guess this should be ...
1
vote
1answer
448 views

Type text into iTerm terminal from apple script

I'm trying to paste text from apple script to iTerm. activate application "iTerm" tell application "iTerm" tell current tab of current window set cmd to "command" keystroke cmd ...
0
votes
0answers
25 views

Operating applications from mac terminal

I have adobe creative cloud with a user logged into it. I want to write an applescript that will logout the user from creative cloud without doing anything. (Run the script and you'll logout). I have ...
0
votes
1answer
211 views

How to change macOS Terminal.app settings programmatically?

My goal is to save the settings for my Terminal.app somewhere and then load them on a new installation or a different Mac. This should include at least the font size, font and the theme I'm using, ...
0
votes
1answer
446 views

How can I set and use alternate icons on touchbar buttons with BetterTouchTool?

In BetterTouchTool, I made a simple mute widget. The provided code (down below) works perfectly fine, but now I want to have the touchbar button change to its alternate colour and icon when the mic is ...
0
votes
1answer
200 views

Ask Finder to open a specified folder with apple script

I use Dragon dictate to automate many things. I would like to open a particular folder in finder. for example when I say "open downloads" it executes the following shell script: open /Volumes/3TB\ ...
0
votes
0answers
100 views

AppleScript to get Photos.app Element

I've used this AppleScript snippet to get all elements in the Photos UI: tell application "System Events" tell process "Process Name" set visible to true return every UI element ...
1
vote
1answer
373 views

Trying to use Applescript variable in curl command inside do shell script

this is my first post so I'm hoping someone much smarter than myself can help me out. Trying to use an applescript variable in the curl command that is inside do shell script. If I put "123456" in ...
0
votes
2answers
211 views

How do I click on “Call Using iPhone” using Accessibility Inspector's Hierarchy?

Here's the AppleScript code: set phone_num to "1111111111"-- (put your own number here) tell me to activate display dialog "" buttons {"FaceTime", "Call", "Cancel"} default button 2 with icon path to ...
0
votes
1answer
136 views

How can I run the following Unix command (script?) on Macs?

I am in a situation where I was informed very late that a program we use to track inventory will have it's EOL October 31st. We have about 400 Mac computers where we have to uninstall the old version (...
0
votes
1answer
61 views

How to open a specific filetype in a folder with a default application to that folder on Macbook?

I have a folder with a single filetype including subdirectories that I'm trying to open with a default application. For example, I have about 3 text editors and I need to open txt files in a folder1 ...
0
votes
2answers
94 views

Applescript to extract YouTube Livestream Video ID

I want to develop an Applescript to extract youtube live stream video ID using the Channel ID. Currently, I'm doing it manually as Youtube changes live stream video ID time to time. For an example, I'...
1
vote
0answers
37 views

Applescript - Customize text-to-speech pronunciation of Chinese characters

I would like to change the default pronunciation of certain Chinese characters and phrases using Applescript. This would be an improvisation of the suggestion given by @JRobert over here. The basic ...
1
vote
2answers
269 views

Run applescript at a specific second

I am not sure if Apple script is what i need but it seems to do most of what i need. Feel free to offer alternatives. I need to send a character to a program at an exact time to start a countdown ...
0
votes
0answers
60 views

Quit application x after y seconds of _application_ inactivity

My problem is related to an earlier question, where an application is quitted after user inactivity. What I'm looking for is however slightly different: how can I quit a specific application x after y ...
1
vote
0answers
98 views

Using Launchd for an Applescript Application

I created an Applescript Application (called Print Release) that runs without issue (code below): do shell script "rm -R /Users/<account>/release.zip; rm -R /Users/<account>/release; curl ...
0
votes
2answers
233 views

Applescript to hide an app/alias

I am trying to write an application using Applescript in Automator that runs on terminal on a Mac Air running Sierra. The account using the application has parental controls set, but I need to give ...
1
vote
1answer
614 views

Using Applescript/Automator to enable Mouse Keys on Mac

I am trying to use applescript and automator to temporarily disable the trackpad while a program loads onto a Mac Air running Sierra. I have parental controls set on the account that runs the software ...
0
votes
1answer
613 views

Batch export selected videos with QuickTime Player 7 using specific export settings?

How can I either use applescript or Automator to batch export video files I have selected in Finder, but NOT using the "Encode Selected Video Files" service method, which only has 4 formats to choose ...
0
votes
2answers
792 views

Force quit Terminal.app using Apple Script Editor

I'm trying to force quit my Terminal.app using Apple Script Editor tell application "Terminal" quit end tell tell application "System Events" key code 53 end tell It does not seem to work. ...
0
votes
1answer
363 views

Replace all illegal characters from folders, subfolders, and files in my Dropbox folder

Our office uses dropbox on Macs to organize our design projects. For several years, many of these files and folders were being saved with characters that are illegal on Windows OS. We have some ...
0
votes
0answers
22 views

Display dialog when menu option, or string in watched file changes?

I'm running a program where I have a shortcut bound in OS X (Sierra 10.12.3) to toggle a menu option. However, there is no visibility in the app of the status of that menu option without navigating to ...
0
votes
1answer
143 views

Use Automator to refresh a page in Chrome if its domain matches a given domain

I found a similar question which explains how to use the Automator for Mac to create a service that will refresh the active tab in chrome. I would like to make a similar service except that I don't ...
1
vote
1answer
44 views

Rename file in directory it is found

I want to find all files that end in file.one.ext and rename them to file.ext I have managed to get this far, however it then moves the file to the working directory, not the directory it found the ...
1
vote
1answer
393 views

How to empty STUCK Trash with Automator

I want Automator script to remove files from Trash without user input. AppleScript empty the trash only works on unstuck files. Similar commands work in Terminal to remove files. sudo rm -rf ~/....
0
votes
1answer
331 views

AppleScript for iTerm2 to activate or create session

I'm trying to write an AppleScript for iTerm2 that for a fixed profile ("session"?) name, let's say "Dev Server", checks whether there is a tab with that profile in any window (or just the current ...
2
votes
1answer
132 views

Applescript to update existing mail rule

MacOS Sierra. This seems like it would be possible based on the following script, which creates a new rule: tell application "Mail" set newRule to make new rule at end of rules with properties { ...
1
vote
1answer
171 views

Mock Desktop switch/4 finger swipe with a script

I have an older Apple wired mouse It has side buttons, which I'd like to program to use like the four finger swipe on the touch pad (the one that switches between desktops). In mouse settings, ...
1
vote
1answer
48 views

Applescript VPN + document.readyState problems

I'm trying to create an Applescript App to connect to my University's VPN Network. The process is done usually through connecting to a specific WiFi network then connecting to the VPN itself (via the ...