Questions tagged [applescript]

AppleScript is the Mac OS scripting language.

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

Allow ssh-keygen-wrapper to access “System Events” for all users in the same computer

When I run my AppleScript in a remote mode, I get this message in an user where the script runs: “sshd-keygen-wrapper“ wants access to control “System Events“. Allowing control will provide access to ...
0
votes
1answer
31 views

AppleScript to enable/disable something during Remote Desktop usage - SOLVED

I've tried to make this script/app work myself, but can't figure it out. Basically, I am trying to enable/disable the functionality of SensibleSideButtons (SSB) based on whether or not I am actively ...
17
votes
3answers
18k views

How do I set up an AppleScript to open a new iTerm2 tab and change the directory?

In OS X, how do I set up an AppleScript to open a new iTerm2 tab change to a directory clear the console echo the current directory I had something like this before for regular Terminal, but I can'...
0
votes
0answers
8 views

OS X start/stop 3rd party preference pane using applescript

I use Hazel (a third party preference pane) but have a need to be able to Start/Stop using an applescript or terminal command (saved as applescript) embedded as an action in a third party macro. ...
0
votes
1answer
46 views

Terminal Command to get app switcher information?

The native app switcher orders the apps based on chronological focus. This ordering is useful to me for a script, but I'm not sure where this ordering information is stored. Is there a way to get the ...
0
votes
1answer
279 views

Hotkey to change Mic volume on Mac OS X?

I'm wondering if there is a way – perhaps via Applescript – to assign a keyboard shortcut to raise the volume of the microphone by 10 e.g., and then the other way: another keyboard shortcut to lower ...
0
votes
1answer
36 views

I accidentally corrupted a plist file belonging to the speech synthesis server, how do I fix it?

I was trying to write an AppleScript that would recognize the language of a selected text, and then set the speech synthesis voice accordingly and then let my Mac speak the text out loud. This is how ...
0
votes
2answers
3k 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
0answers
18 views

How to Clear VLC Playlist with Apple Scripts

By default, VLC will keep the songs that were played in the last session as part of the playlist. I have an AppleScript that plays music that is stored as MP3 files in a folder. tell application "VLC"...
0
votes
2answers
6k views

Applescript to close box by hitting ok automatically

I need to create a script that automatically closes a popup box that opens approximately every 55 - 65 seconds. Once the box opens, you merely hit OK (within the box) and it closes. I created an ...
1
vote
2answers
109 views

Applescript won't move onto next instruction without ending shellscript?

I'm a new user to Applescript and programming in general. I'm trying to create a script that will 1) load a Renpy project through the terminal and 2) then move the resulting project window to a ...
3
votes
3answers
4k views

How to open a new Firefox window with Terminal

I am running Firefox v10.0.1 with OS X Lion v10.7.3 From the Apple dock, you can right-click on Firefox icon and choose NEW and a new Firefox window will open. From terminal, I have tried open -...
-1
votes
1answer
12 views

How to create system notifications for Macbook Prof / MacOS

For Ubuntu it's easy to create a desktop notification: https://askubuntu.com/questions/187022/how-can-i-send-a-custom-desktop-notification it looks like: $ notify-send "Hello world!" on MacOS, I am ...
0
votes
2answers
2k views

Inserting Keynote slides into a Pages document

I have a number of training documents which are formed from a word processor file and a slideshow. I'd like to be able to keep them together, ideally by inserting the slides from Keynote into Pages. ...
1
vote
1answer
2k views

Pass arguments to osascript via shell function in OS X Mountain Lion

The answer in How to open a new Firefox window with URL argument is broken in Mac OSX Mountain Lion (10.8.2). I can't comment on that answer or question, so I had to create a new question. It fails ...
0
votes
0answers
12 views

Run script after all items in Login Items are opened

I want to run an AppleScript when macOS is done with opening my Login Items. Is it possible to listen for a signal from macOS when it's done with that?
0
votes
0answers
65 views

Need help working with automator applescripts in Numbers on MacOS catalina

I am working with numbers sheet and I want to create a keyboard shortcut so that when I press a button the script searches for the number "1" in column I, when it finds the number "1" it will increase ...
4
votes
1answer
3k views

Applescript create event in calendar, how do I remove the default alert?

Running 10.8 Mountain Lion, I'm trying to create a new event with Applescript like this: set theDate to (current date) tell application "Calendar" tell calendar "Calendar" set timeString ...
1
vote
2answers
2k views

LaunchAgent plist to keep an app running and hiden

I'm using the following script <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist ...
2
votes
2answers
191 views

How to get the pid of a opened Terminal window in MacOS?

Background I want to obtain the pid of a specific Terminal window. ps -A | grep -w Terminal.app | grep -v grep | awk '{print $1}' However, the above grabs the pid of the entire application and not ...
0
votes
1answer
79 views

How to close a Terminal window using bash and AppleScript without using SystemEvents?

Background I am trying to create a script that when executed, opens a new Terminal.app window executes the desired commands and closes the window when complete. One solution was to use SystemEvents ...
1
vote
2answers
310 views

How do I target and close a specific Terminal window in AppleScript?

Background Given the below terminal script, I want to modify the osascript so that instead of targeting the front window I am targeting the specific window that is opened from the AppleScript. ...
0
votes
2answers
867 views

script needed to Reset group permission to enclosed items in folder OS X Yosemite

Error with Excel document falling read only on server shared document. i'm looking for a script to apply "group" folder permission to all included files.Every day at a specific time 8pm.to fix ...
0
votes
1answer
53 views

toggle iCloud preferences from terminal or applescript

I'm looking for a script to toggle iCloud preferences in system preferences. I need to automatically uncheck all the voices (Photos, Mail, Contacts, etc) leaving only iCloud Drive and Find My Mac. ...
0
votes
0answers
21 views

How do you modify OS X Automator's prebuilt actions?

I am trying to use the actions that are pre-built for automator in Mac OS X (Mojave, for me), but modify them slightly. For example, the "rotate images" action - I would like to have the option of ...
0
votes
1answer
137 views

Applescript: How to open a random file from a specified volume? (.dmg location)

Ok so if I want to open a random file from a folder on my Mac, I can use the following script succesfully: tell application "Finder" open some file of (folder ("⁨⁨Users:chris:Desktop:photoAlbum")...
0
votes
0answers
54 views

How to move all open tabs from Firefox to Safari?

Someone else asked a similar question but it was for moving tabs from Safari to Firefox. I've used this AppleScript and it works great: https://superuser.com/a/1210777 tell application "Firefox" ...
5
votes
3answers
7k views

Mac OS: How can I launch the iTerm terminal, with a specific profile, from Automator or AppleScript?

I'm trying to assign a global keyboard shortcut that will launch a new window of iTerm, with a specific profile. (I managed to do this to launch a new Chrome window with Automator and AppleScript, but ...
0
votes
0answers
26 views

Command or script to send focused window to the background

Does anyone know if there is a hotkey or ApplesSript around for sending the active/focused window (app even) to the background (behind other windows). Not hiding (cmd + h), not minimizing (cmd + m). ...
0
votes
0answers
35 views

What is the most perfect way to record a workflow into AppleScript so I can program it?

I tried to write an AppleScript code to control a music sheet application iReal Pro to create sheets automatically, but I tried so many ways and I still can't get the application UI elements exactly,...
0
votes
1answer
219 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 ...
0
votes
0answers
29 views

indesign duplicate filelink and update link

i have indesign file with image inside, how I can duplicate the original image in the desktop and relink to the copy in document? I try this code in script (but he don't duplicate the file): if(...
12
votes
5answers
27k views

Execute applescript without open the editor

Every time I want to run an applescript the editor pops up. Is there a way to run it directly?
1
vote
2answers
839 views

How to open a random file from a specified folder using AppleScript?

Here's the code I have now: tell application "Finder" get some file of (folder (POSIX file "Desktop/musics")) end tell
0
votes
0answers
28 views

Keyboard shortcuts in languages other then english

There is a global problem with keyboard shortcuts on a lot of apps (photoshop, sketch, xd... to name a few) which is when you using languages other then english you can't use those keyboard shortcuts. ...
1
vote
2answers
162 views

Delete Directories that Contain Specified File in Mac OS X

How do I delete a folder that contains a file or folder with a specific name? E.g. I want to delete all folders that contain the file "things.txt": /dirA/ /dirB/things.txt /dirC/ /dirD/things.txt /...
1
vote
0answers
38 views

How to run an Applescript at shutdown

I am trying to track the occurrences and duration of power outages. I have my computer(Mac High Sierra) powered by a UPS and set to shutdown when there is an outage. I have an applescript that when ...
5
votes
1answer
12k views

How to zip multiple files into separate archives?

I admit this question was asked here before: Like Zip into separate files where the person who asked didn't specify the OS he used and received no answers. I need to separate a huge directory into ...
2
votes
1answer
795 views

How do I create a Genius playlist in iTunes 10 from a script?

I want to create a script that starts a new Genius playlist based on the currently-playing track to use in LaunchBar. Unfortunately iTunes doesn't expose any Genius-related functionality to ...
0
votes
1answer
283 views

Is there a way to enter 'tab', 'function' or 'escape' keys as keyboard shortcuts for voice control Mac OS X?

I am using voice control in Catalina OS beta 5 to map various keyboard shortcuts to custom commands. Most key shortcuts like "command-f" work just fine, but any key shortcut that uses either the 'tab',...
0
votes
1answer
117 views

Automating Image format and size change

I'm a novice, trying to create a Mac OS Automator app or AppleScript that will accept images (PSD, tiff, png, jpeg) when dragged on the app's icon, convert to a different format, and resize them. I ...
0
votes
0answers
23 views

Change “Require password after screensaver/sleep” in High Sierra via the shell

Duplicate of I want to make Macintosh Security Settings Location-Aware and Automatic, Change Mac "Ask for password after screensaver" delay, Toggle "ask for password after screensaver/...
5
votes
1answer
2k views

Determine Mac's screen state using AppleScript

Is there a way to determine what state the Mac's screen is in? I'd like to have a script that checks if the screen is in a non-active state; so either the screen saver is running or the display is ...
1
vote
1answer
736 views

Applescript to run when connection to specific network on OSx

I have an apple script that I can manually run that will connect to a couple network drives. I would like it to have that script run when my mac connects to a specific wireless network connection (...
5
votes
1answer
4k views

Applescript to connect to bluetooth device

I'm trying to create an applescript to allow me to connect to a bluetooth device by it's Bluetooth ID. So far, i've managed to get an applescript to turn on bluetooth if it's off. Here's the code: ...
0
votes
0answers
24 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 ...
4
votes
5answers
6k views

Applescript to lock the screen

I need a little Applescript to lock the screen, the same behaviour I get when I click the Keychain icon in the menu bar and choose "Lock screen". I found a way to activate the screensaver, but it's ...
0
votes
1answer
60 views

Applescript - Why killall not killing my app

My applescript's app name is "myApp", I'm just wondering why it's not killing my app after the Launch of Tableau. "on run" is working as expected, and killing the host app after launching Tableau, ...
0
votes
1answer
276 views

Run unix file with applescript with showing result

I use the following script https://github.com/chilcote/warranty It works very fine with terminal. Now I want to use it with applescript. I think about "to do shell script" and that the script is in ...
0
votes
0answers
80 views

Mac Automator & AppleScript issues

Thank you in advance for helping me out (if you so choose). I am currently creating an automator sequence that will move .pdf items from a "Bin" folder on the desktop to a variety of folders of which ...

1
2 3 4 5
8