AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

5
votes
3answers
2k views

Logout user script

I am trying to create a script in ARD that will let me logout a user. Now I have a script which does start the logout, but I want it to execute instead of waiting 60 seconds. The script currently is:...
4
votes
4answers
4k views

Quotes within quotes applescript

I am doing an applescript that is supposed to set an command with quotes an variable. This is the code so far: set myString to "This is a "quoted" text." But an error occurs because applescript ...
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 ...
1
vote
1answer
34 views

Opening a new terminal from the command line and running a command on Mac OS X 10.10?

So I want to run a script, that launch when I log in, in a new terminal and print in a few line. Do I need AppleScript as for what I've read so far ? Is there not a simple bash command to run this ? ...
2
votes
1answer
4k views

Need an everyday reminder at a specific time of the day on Mac OS X?

Does anyone know how I can create an everyday reminder that pops up every day at a specific time to remind me of doing something? I need to make it remind me everyday at 1:00pm to update my daily blog....
1
vote
1answer
2k views

Converting rtfd files to txt, without deleting hyperlinks and pictures in OS X

I have a lot (>10k ... this can't be done manually) of rtf and rtfd files that I would like to turn into txt files. Unfortunately they contain pictures and hyperlinks that I don't want to lose. ...
28
votes
3answers
29k views

Assign a shortcut to running a script in OS X

Does OS X provide an easy way to bind key combinations to commands which are typically run on the command line? For example, is there some way to assign ⌘ Cmd+L as a global shortcut to quickly lock ...
0
votes
0answers
7 views

Intercepting an Applescript script to work on a spreadsheet

I have just begun using Applescript & have the following question: is it possible to make an applescript script on OSX El Capitan to open a spreadsheet, intercept the script to make changes/...
0
votes
0answers
21 views

How to open iTerm2 version 3 in Forklift

I am looking for a solution which can open iTerm2 version 3 as the default terminal. For iTerm2 version 2 there were multiple AppleScripts on the internet which worked well for opening the current ...
0
votes
2answers
23 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
0answers
13 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
94 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
8k 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
22 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
67 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
15 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
68 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
54 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
289 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
22 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
70 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
45 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
60 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
50 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
23 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
758 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
49 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
53 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, ...
2
votes
0answers
171 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
55 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
70 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
84 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
798 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
201 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
8k 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
57 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
86 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
304 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
53 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
30 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
30 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
273 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 ...