AppleScript is a proprietary programming language in Mac OS X to control and exchange data with applications.

learn more… | top users | synonyms (3)

2
votes
0answers
41 views

Applescript Printer Alerts via iMessage

Is there a way to send an SMS via Applescript/Automator in either of these scenarios: When a low printer ink alert occurs ("Cyan is at or below 10%) With the periodic status of ink levels ("Cyan=10%,...
1
vote
0answers
66 views

Save pdf from sender in Mail.app to folder with applescript

Trying to find out how to save email attachments like a pdf to a folder and can't figure out what I'm missing using the following. Any ideas? using terms from application "Mail" on perform mail ...
1
vote
0answers
16 views

Applescript claims to run shell script, but script has no effect [duplicate]

So I have a bash script like this: #!/bin/sh FILE='some_file.js' gsed -i -E 's/something/somethingelse/' "$FILE" echo "Modified File" When I run this from command line, it echoes the last line, so ...
2
votes
2answers
225 views

Mail Script Help

I forward a lot of emails to Evernote and Nozbe (similar to OmniFocus) as I work to get my inbox to zero. When I am on my iPhone, I move emails to folders (Evernote, Nozbe, or Archives) depending on ...
3
votes
1answer
88 views

Automator Service to insert text only available when text is selected

I'm trying to make an Automator Service to insert the current date. I have one that works but it is only available in the Services menu when text is selected. I need it to be available when there is ...
4
votes
1answer
70 views

Change font of Terminal programmatically w/o restarting

At home I've got a nice big display that unfortunately does not have the same resolution as my retina macbook does. I'd like to use a pixel-font on the low-res screen and a nice smooth one on the ...
1
vote
1answer
66 views

Control haptic engine and force touch from terminal

Is there any way that I can create haptic feedback with the integrated force touch trackpad on my rMBP using a terminal command (preferably without AppleScript, but if that's the only way, then sure.)?...
0
votes
1answer
32 views

Applescript: automated key press of spacebar/left click at defined intervals

I'm new to apple scripts and was wondering if there is a way the program the computer to press spacebar or left-click at defined times upon running of the script. For instance I will be able to same ...
1
vote
0answers
40 views

AD network drives and or apple script editor

I have a new Mac laptop. I have it on a Windows domain and I get my drive mapping in the sidebar when I login with my AD account. When I change my account to a mobile account I loose the mapping in ...
1
vote
2answers
42 views

Can I change the button “m” with space bar?

My space bar won't work so I want to use the m button as space bar. Is there a way to do that? Maybe with the Automator using an apples riptide or something?
0
votes
1answer
55 views

How can I toggle network services with a script?

Currently I can do this only on a per connection basis using this script: property status : "none" property val : "none" on get_status() set status to do shell script "sudo networksetup -...
0
votes
0answers
37 views

Change modified date in Finder for date added

I've been trying to do this for a while. For backup purposes, I'm looking for an applescript that replaces the modified date of folders and content (files and folders) with the date added. It would ...
0
votes
0answers
30 views

applescript to create keynote chart with floating point values

I am trying to create an applescript which can generate plots in Keynote. When I try this, it seems that any floating point values are being converted to integers. Here is a short applescript which ...
-2
votes
1answer
30 views

AppleScript Syntax Error

For some reason, when I attempt to run this code in AppleScript, I get the following error: Syntax Error Expected end of line but found “"”. Here is the troubled portion of my code: if a = ...
0
votes
2answers
56 views

How do I run a terminal command for different values

How do I have to label i such that the do command is repeated for all values of i. E.g. if i =2: cd /Users/xxx/zTree; wine explorer /desktop=1,640x480 zleaf.exe /language english /name lab1 cd /...
5
votes
3answers
1k views

Copy message_id from selected message

In Mail, when I've selected a message, I would like to have a shortcut to copy the message_id (see my previous question) to the clipboard. How do I manage that? Applescript, I presume?
0
votes
0answers
37 views

Open SSH server files automatically with AppleScript

I am trying to build an Apple Script which will: 1. Open terminal login in SSH with details 2. After login, open a python script which is on ssh server automatically I want to do all of these tasks ...
0
votes
0answers
27 views

How to quit a Chrome application using AppleScript?

I am using this Chrome app to conveniently handle my email as if I am using a dedicated app. I would like to be able to quit it from AppleScript. How do I do that? tell application "Google Chrome" ...
1
vote
2answers
83 views

How do I create an automator to forward mail?

My parents both have GMAIL accounts. We were wondering if there was a way to forward email so when my dad's account receives email from a certain sender it would be forwarded to my mom's account. ...
1
vote
3answers
83 views

Copy specific files and keep the subfolder structure

I got a folder with a large amount of files with different suffixes in several sub folders. My automator workflow works as follows: Ask for Finder Items Get Folder Contents (sub folder option ...
5
votes
0answers
51 views

count of desktops only returns 1

Any idea why the following script would only return 1, when I clearly have more than one Desktop open? tell application "System Events" set n to count of desktops display alert n end tell I ...
0
votes
0answers
51 views

Mail.app rule to run Apple Script that puts message content into a variable

I am trying to learn Apple Script by writing a script that will automate extracting text from an email when it arrives. When ever I receive an email from a specified sender I want to save the text ...
2
votes
1answer
97 views

How to ensure that windows opened from the Dock open in the current Space/Desktop

A Mail window was in the Dock, and I clicked on it to restore it to my current Desktop. Instead of opening where I can see it, it went to some other Desktop, presumably the one it was in when it was ...
0
votes
2answers
346 views

Applescript to Heart or Love or Favorite song

Anyone know if there's away to heart/love/favorite a song in the new iTunes via applescript? Basically I want the ability to heart a song from Apple Music without switching back to iTunes.
0
votes
0answers
19 views

Notes script to recursively walk directory structure?

I previously asked this question, for getting a list of notes in a specific Notes folder. I am trying to generalizing into something more like accessing a folder in a filesystem. One problem is that ...
2
votes
2answers
459 views

AppleScript keystroke ignoring numbers

A very simple AppleScript like this: tell application "System Events" keystroke "abc 123" end tell results in just “abc” being typed. Online resources suggest this should not be the case. ...
0
votes
0answers
26 views

Change Geektool image using script

I'm looking to have an image display for a keystroke and then revert/change to a transparent image after a few seconds. I'm using an AppleScript file and image geeklet. The URL (or temp) image file, ...
1
vote
0answers
38 views

How to detect number of lines in AppleScript

I want to use TextWrangler as an R-editor. To make usage more handy I found a script online by Jean Thiolouse which I edited slightly: tell application "TextWrangler" set the_selection to (...
5
votes
3answers
2k views

Why does this applescript not actually set the input volume to zero?

I have this command that builds a script to mute the input volume. The input volume is not fully muted, though. It seems to be closer to 10% than 0%. osacompile -x -e 'tell application "System Events"...
0
votes
0answers
28 views

Microsoft Word on OS X running executable hyperlinks from 'launchd'

I'd like to create a script that calculates statistics on all opened applications and what parent process has initiated them. I would expect that the ppid for each running process will represent the ...
0
votes
1answer
32 views

Geektool coding to remove image after a set time

I'm trying to edit a 3rd party script written in AppleScript (OAS...I think) to dim the volume after showing changes. I've tried changing the opacity & switching to a transparent image using a ...
1
vote
1answer
83 views

Get current app from two instances with same name by Apple Script

How to address an active window of an active app by AppleScript when two instances of the same app are running? The script below addresses the other app. Probably because the name and id of the app ...
1
vote
2answers
1k views

using automator/applescript to upload files to a web form?

I have a bunch of files I want to upload to web page. Unfortunately the web form for uploading only allows me to specify one at a time (it spawns and 'open file' dialog). Is there an easy way to do ...
0
votes
0answers
16 views

How to handle a save-dialog with System Events

Logic Pro X is only scriptable with "System Events", because it has no AppleScript library. I have to close a project in LPX and it works: tell application "System Events" to tell process "Logic Pro ...
0
votes
1answer
57 views

Switch spaces with apple script

My goal is to switch spaces from within an apple script. My shortcut to switch to the 4th space is ctrl+4, but when I tried this in an apple script nothing happens: tell application "System Events" ...
0
votes
2answers
60 views

How to check which files have been copied to the main hard drive and which ones have not been copied?

I formatted my MacBook main drive some months ago and, in order to not lose data, I created a .dmg image of the hard drive before the formatting procedure and saved it to an external device. Then, ...
1
vote
2answers
43 views

Global hotkey that send keystroke to another app

I want to configure a global hotkey like F5, and when I press F5 it should send [Command]+[Option]+[Control]+[Up Arrow] to the Skype app. Anyone knows an app that I can do this, or script.
4
votes
3answers
1k views

Is it possible to disconnect a bluetooth connection using Applescript?

I want to disconnect a connection to a bluetooth device through an Applescript. Please note that I don't want to disable or enable bluetooth, I just want to disable one specific connection.
0
votes
1answer
111 views

Apple Script not running as expected

The following is an applescript which is meant to take the body of the latest email and extract text out of it. As you can see the result is shown below. This result is show as the script was running ...
0
votes
2answers
50 views

Cannot Run GUI AppleScripts

I recently upgraded my system to OS X 10.11 El Capitan and ever since, my AppleScript which enables GUI scripting cannot be run. Part of the reason is obvious, the Universal Access pane in System ...
0
votes
1answer
46 views

I need an application to read aloud any emails that come into a specific email address

I want a sort of audio server which sits in background (running on OS X, not iOS) and whenever an email arrives at a specific address, it reads it aloud. Ideally there would be also an option to ...
0
votes
1answer
24 views

Having problems with an AppleScript

This isn't launching FaceTime when I want it to! I want it to launch an app, and you get to choose what app it launches, so if I press Google Chrome, then it launches Google Chrome, but it doesn't ...
1
vote
1answer
46 views

AppleScript help

I'm trying to make an app that will open different apps, and give you a list, but I keep getting error messages. Is it possible to do this? display dialog "Hello and welcome to my app!" buttons {"...
0
votes
0answers
57 views

Converting .VCF to .CSV

I'm trying to get a group of contacts from BusyContacts to MailChimp. I have exported the group as a VCF file. Now I need to convert that VCF file to CSV. When I open my VCF file in a text editor, it'...
1
vote
1answer
42 views

Apple Script to Export from application

I'm new to AppleScript and wanted to export my citations using AppleScript. I found the following but am not sure the structure to change the following to my path folders, can you please provide an ...
1
vote
1answer
41 views

Applescript change folder and terminal commands

I have tried the following but cannot seem to get this to work: do script "cd ~/desktop/test; for x in ls -1 | sed -e 's/^\(.\).*/\1/' | sort -u; do mv -i ${x}?* $x done" I'm wanting to perform ...
0
votes
1answer
95 views

Terminal Command into Applescript

I have the following terminal command that I want to automate using applescript. I also would like to have a command to cd directories to the folder where I want to apply the command first. After cd ...
0
votes
1answer
33 views

Start Terminal in AppleScript

At work I'm overseeing several users who use MacBooks to connect to our enterprise environment. One of our vendors has an old server which users access via ssh. I've created an Automator workflow to ...
0
votes
0answers
11 views

Controlling Scroll Bars

On our company page in LinkedIn, under the analytics tab, there is scrollbar. I want a script which will scroll down to the bottom, hit "see more", and recursively continue until the data is ...
1
vote
1answer
244 views

Extract links from email based on the anchor text, not the href

I am putting together an Automator workflow that will allow me to bind a hotkey to a Smart Mailbox listing and effectively automate the task of clicking "Unsubscribe" in emails which have that text ...