AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

0
votes
2answers
16 views

OSX control volume with keyboard

I'd like these keybindings: Cmd+PageUp = volumeUp Cmd+PageDown = volumeDown I followed these instructions: creating AppleScript worked fine, but it is impossible to set Cmd+PageUp shortcut in ...
0
votes
2answers
3k 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 ...
0
votes
0answers
8 views

AppleScript Dismiss a website dialog box whose text contains something unique

I have this code to dismiss a popup for a website. The popup has no title, however it has text. How can I make this so it doesn't do it for all websites and/or doesn't do it for all dialog boxes. I ...
0
votes
1answer
91 views

Applescript command to make window unclosable

I have an applescript program that auto opens whenever I wake my computer. I would like it to be unclosable until I input a password into it. Tried searching but found absolutely no sources that ...
9
votes
4answers
7k views

Applescript to open a NEW terminal window in current space

Yes, I'm having a terrible newbie experience with Apple Script. I need to open a new Terminal window in the current desktop space. NOT move me to another space which has a Terminal running and then ...
0
votes
0answers
18 views

applescript to change tab forward or backward in chrome

So I'm aware that using using ctrl+page up sends a command to chrome that activates the previous tab.. and ctrl+page up activates the next tab I tried sending the keyboard command to chrome using ...
0
votes
1answer
39 views

How to run a shell script from an AppleScript?

I am using a Mac running OSX Yosemite v.10.10.5. When I try to run my shell script from my AppleScript, I get the following error message: Error message at AppleScript Script Editor error "sh: /...
0
votes
0answers
12 views

How to cd into my local git repo from an AppleScript?

I am running a Mac using OSX Yosemite v10.10.5. I want to push my local git repo to my remote using AppleScript. So the git code would be: shell git init git add README.md git commit -m "first ...
4
votes
1answer
58 views

Remove All Illegal Characters from All Filenames in a Given Folder and subfolders

I Know this was was basically answered and the automator with the shell script (Sanitize Filenames) works great, but I need it to also do all subfolders as well. And if possible trim the file name ...
0
votes
1answer
53 views

Shell script, AppleScript Mac OS X

I’m trying to copy embedded metadata from image files and write to a .txt file, as well as generate MD5 and SHA1 checksums for the same images to be added to the same .txt file. I can run this ...
0
votes
0answers
217 views

Applescript/Automation in Outlook 2016 for Mac

Im trying to script some automation for some repetitive tasks I do in my workflow. My script (as of now) needs to accomplish only a basic task, but nonetheless, timesaving. I need it to (when called ...
5
votes
2answers
4k views

Creating “save as” functionality to .eml file in AppleScript

I'm new to AppleScript and trying to figure out how to save a Mail.app message as an .eml message. Ideally, I would like it to act similar to the Mail menu bar actions, in which it saves the message ...
0
votes
0answers
21 views

open ssh server file automatically with apple script

Hello respected persons , i am trying to build a apple script which first open terminal login in ssh with details and after login it open a python script which is on ssh server automatically . i ...
0
votes
1answer
63 views

How do you add a spotlight comment to a folder

How do I set a spotlight comment for a folder using Bash. (Or Applescript) The following example is not working: osascript -e "tell application \"Finder\" to set comments of alias POSIX file \"$...
0
votes
0answers
44 views

Applescript to upload files to OneDrive

I am wondering if anybody knows how to Upload a file to OneDrive using an applescript. I would connect this applescript to Automator so if the script could include the necessary variable parsings for ...
0
votes
1answer
49 views

Send click event to dialog shown through display dialog command in OS X Terminal

I have an sh script that displays a dialog; this dialog can be closed by the user but I am looking at a gracious way to close it, from within another similar script, run at a particular moment, if ...
0
votes
1answer
49 views

Cannot execute ssh-ed osascript properly inside of shell script

I have created a ip-down script in my etc/ppp/ directory. Essentially I am trying to kill certain programs/servers when the VPN disconnects, then display a notification on another computer via ssh. I ...
0
votes
0answers
20 views

How to script detection of an OS X program bouncing in the dock?

How can I use AppleScript or something similar to detect the presence of an app which is bouncing in the dock (in this case Adobe Illustrator)? Once I detect that Adobe Illustrator is requesting ...
2
votes
2answers
736 views

Is it possible to grab and store the returned window id of a terminal opened through applescript or bash?

I have been working on this "dashboard" to help control my localhost server environment. It has been scripted in bin/bash for reference. I recently discovered I can use the bin command "osascript" to ...
1
vote
0answers
42 views

How to get input with a custom dictation command

I'm trying to write a few scripts to allow me to write code via voice. However, I need a way to specify a way to capitalize a variable name. For example, I want to be able to say, "stud my super ...
0
votes
0answers
45 views

Mount AFP from terminal / AppleScript

I try to mount an AFP / SMB drive either from terminal or AppleScript, Used to have a code for that but can't find it, the only issue is my password have "@" character with probably make the terminal ...
0
votes
0answers
13 views

Mailing by aid of AppleScript with no user interface dialogues

I want to send a couple of emails with an AppleScript. The annoying thing about this script is that I have to do the last part of it, clicking the arrow icon. How can I avoid this? Sorry I am a newbie ...
9
votes
3answers
5k views

Programmatically set the color of a tab in iTerm2?

My daily workflow includes me Launching iTerm2 Creating 3 tabs Setting one tab each to red, orange and yellow Changing to a specific path in each tab I would like to script this process; shell, ...
1
vote
0answers
147 views

Keyboard shortcut to “Love” currently playing song in iTunes 12 on OSX

It seems as if apple has forgotten to build in a keyboard shortcut for "Loving" or "Hearting" the currently playing song in iTunes. This is unfortunate because often whilst I am working I would like ...
1
vote
1answer
53 views

Export iTunes library?

A long time ago, I remember using an AppleScript I downloaded from somewhere that exports all the music files from my iTunes library into folder neatly organised by artist and albums. Now, I am ...
4
votes
4answers
5k views

Switch between Google Chrome Tabs using AppleScript

I was hoping that the following code would do the job, but no cigar: --Only the window is brought into focus tell application "Google Chrome" activate tab 1 of window 1 end tell
0
votes
1answer
55 views

Automatic open new browser tab on Mac OS X

Im trying to create a action in Automator, but I am not sure if its possible only use this software or I would need use applescript. I need to create a action for when I set a specific URL in some ...
0
votes
1answer
68 views

Is there a way to have two or more clipboards via keyboard shortcuts for storing & using multiple text items simultaneously? (OSX)

I would like to be able to have multiple clipboards on Mac OSX (happen to be using Mavericks currently). The end-solution would look something like this: Let's say I copied one piece of text using... ...
1
vote
1answer
24 views

How to send a signal to a running Applescript

I am running a script that basically has a loop inside a loop. I need some way to signal this script to break out of the inner loop. repeat doxyz repeat doSoreWork if signalPresent ...
2
votes
1answer
83 views

Are Snow Leopard text substitutions scriptable?

I prefer using typographical quotation marks when possible, so I love the Smart Quotes part of Snow Leopard’s text replacement feature. But there are a few cases in which I need to toggle it, and it’s ...
1
vote
1answer
746 views

How to create a schedule for SelfControl app

I want to block my blacklist Mon-Fri 6am-12pm and 1pm-5pm (closely related to this post), but I don't know enough about Applescript to know how to set up a schedule. Any ideas for how to achieve this?...
3
votes
2answers
6k views

How do I run an Automator action, shell script or AppleScript on startup in OS X?

I know you can run applications on startup on a Mac, but can you run an Automator action, a Service, a shell script, or an AppleScript on startup instead? I also know you can save all of these as an ...
0
votes
1answer
175 views

Sharing variables between applescript and bash script in same script

Is it possible, in a bash script, to have a variable, but also allow applescript (with osascript) to use that variable?
9
votes
8answers
7k views

MacOS X: How to have a handy “Open this folder in iTerm” shortcut?

I think the title states exactly what I want to do. I want a shortcut or even a button within Finder which fires up a new iTerm Tab and changes the location to the location i've open in Finder. Some ...
0
votes
0answers
26 views

applescripted keybinding issue with extended keyboard's number keys

I've written an applescript that remaps the Switch to Desktop n commands to the extended keyboard's numbers instead of the main keyboard. I've looked up the codes and they are Key codes 82 - 92. The ...
0
votes
1answer
56 views

How do i write an applescript application from terminal?

I want to write an applescript application from terminal. So far I have been able to write an .scpt file but that is not enough. I need to convert it to an applescript application that can then be ...
0
votes
1answer
78 views

Creating a cycle between spaces on OS X

On Windows, I constantly used the keyboard shortcut 'alt-escape', which enabled me to move from one window to another without having to press x times 'alt-tab'. I'm new to mac OSX, and it seems that a ...
0
votes
1answer
250 views

AppleScript to mount and unmount drives

this is my first post on this site, so excuse me if this is a double post but I couldn't find anything similar. I'm on Macbook Pro 13 early 2011, I have installed an ssd and moved the hdd to the ...
0
votes
0answers
50 views

AppleScript and Pages: change font of numeric characters

I have a Pages document written in a non-standard font. It's actually the New Testament in a Greek font, with verse numbers throughout. While the numbers show up properly, the font lacks the ability ...
1
vote
1answer
29 views

writeToFile in a .app

I am currently trying to write content inside an Applescript.app which is a resource file. I can write to the .scpt file if I copy it in a different folder out of the Applescript.app @...
1
vote
1answer
29 views

How do I close a window from an application but not quit the application

I'm trying to have a shell script run and then close itself but not quit Terminal all together. Here's what I have: #!/bin/sh while [ "$JOB_NUMBER" = '' ]; do echo -n "++++++++++++++++++++Job ...
1
vote
1answer
240 views

automatic new mac setup (dotfiles, scripts, etc)

I'm looking for a way to automate the setup of a new macbook I'm about to purchase. I've done through quite a few during the years and it always takes forever to get everything up properly. I don't ...
2
votes
3answers
11k views

Open new terminal tab and execute script

I need to merge two osascript scripts, so that with one command I can open a new terminal tab and execute a script like echo hello into that new tab. This one opens a new terminal tab. osascript -e '...
0
votes
0answers
36 views

Applescript - how to tell which window is topmost on second screen?

I need to find topmost window on a given screen. I thought I could calculate the screen using position or bounds so this is not a problem, however I am struggling with the index property. I tried this:...
0
votes
2answers
45 views

Click Every Word that ends with “.log.gz” in Any Language Compatible with Google Chrome

I have looked up the answer to this already and cannot do this with the programming languages I know, so I'd like the code for this and an explanation as to how it works so I can use this in future ...
6
votes
5answers
4k views

How do you duplicate current open Finder view in new tab (Mavericks)?

In a thread on this forum there is an interesting solution on how to open a duplicate of an already open Finder window with the help of an AppleScript: How do you duplicate current open Finder view? ...
1
vote
1answer
182 views

Write content to file with Automator

I'm building an Automator Service to create an .html file and write some text in it. I've managed to create my .html file by using the New Text File action, but how can I write text in it? I see no ...
4
votes
4answers
4k views

Quotes within quotes applescript

I am doing an applescript that is supposed to set an command with quotes an varible. This is the code so far: set myString to "This is a "quoted" text." But an error occurs because applescript ...
1
vote
2answers
44 views

How do I to modify Automator Service ditto command?

Using and Automator Service and an AppleScript that is redly available and exists on this thread of but a "GUI" around ditto. The solution works well, however, I am not getting the behavior I expected....
1
vote
0answers
88 views

Toggling Yosemite's Notification Center between “Today” and “Notifications” views (back and forth)

I want to create a keyboard shortcut/trackpad gesture to: - display Yosemite's Notification Center first - then toggle back and forth "Today" and "Notifications" panes every time the corresponding ...