AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

0
votes
1answer
35 views

AppleScript hangs when mounting notremovable encrypted image

I want to mount a dmg as nonremovable image using AppleScript as described here. The difference is that my dmg is encrypted. When I execute do shell script "hdiutil attach /path/to/my.dmg ...
0
votes
0answers
11 views

How can I start a Hangouts phone call with Applescript/Terminal?

I want to initiate a Google Hangouts phone call with Applescript, or Terminal ... or python. (Hangouts.app has an AS dictionary, but with only the default suites.) Basically I want to emulate ...
5
votes
2answers
1k views

Folder actions on OS X observing all subfolders

I have a folder that I would like to add a folder action to. The action works great when the file is added to the top level. But when a file is added to and sub-folders, the action is not enabled. Is ...
0
votes
1answer
20 views

Target Display Mode not working when no keyboard present

When I try to use some kind of command + f2 command either via applescript or screen share, it never works when the keyboard is no longer present. Example, I have an iMac and a laptop where the ...
0
votes
1answer
18 views

Insert AppleScript variables without comma seperating them from text

I need to run a shell script in an applescript like this set key_status to (do shell script "defaults read " & path_to_plist & " PlistKey") But unix gives an error because this script seems ...
3
votes
1answer
1k views

AppleScript: Open a new window in current space without switching to active window in another space

I want to have an application open a new window in the current space without switching to a space in which a window is already open, but I want to keep the When switching to an application, ...
2
votes
1answer
138 views

How to get which file is requested to open using a mac application?

I have created a mac application which can be open my file extensions. But when I tested it, I dont get the path of the file requested to open using the application, instead I got the "psn_0_151589". ...
0
votes
0answers
53 views

Outlook on a MAC and the 1GB limit

While waiting for MS Office 2014 to arrive and address the 1GB limitation, has anyone written an AppleScript for detecting file size on an Outlook file/folder to send a threshold exceed warning ...
0
votes
1answer
61 views

Setup a Watch Folder over a network

I'm trying to setup a Watch Folder in AppleScript which is over a home network. I want the script to generate an email when a file (or files) is dropped in the Watch Folder. How can I achieve this?
1
vote
1answer
29 views

Find path of button in browser for Applescript

I'm trying to click on a button in Safari with Applescript. I know the code must be something like: tell application "System Events" tell process "Safari" click button " ENTER " of ...
0
votes
1answer
82 views

Why Does Clicking on Applescript Notifications Open the AppleScript Editor?

I'm experimenting with AppleScript and with Python. But the big issue i'm having now is not about Python specifically. The end goal is to be able to write Python scripts that use AppleScript features. ...
0
votes
0answers
27 views

Batch format and convert word documents in mac OSX

I am looking for a way to format multiple word documents (in a same formatting) and then save them as PDF. Specifically: Format orientation, page margins, page columns, and font. Save the formatted ...
3
votes
2answers
2k views

How do I close a window from an application, passing the file name?

I’m trying to produce an Applescript-based shell command that tells the Preview application from Mac OS X to close a particular window. #!/bin/sh osascript <<EOF tell application "Preview" ...
3
votes
4answers
2k 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? ...
0
votes
2answers
41 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 ...
2
votes
2answers
789 views

Get the media buttons on my bluetooth headset working with Spotify on OS X

I just bought a Parrot Zik, which is a pair of bluetooth headphones with volume control, play/pause and next-prev buttons. (Or gestures, as they come with the Zik). The phones work beautifully with ...
-2
votes
2answers
102 views

Mac always restarting after reboot

I created an AppleScript to restart my Mac: tell application "System Events" restart end tell I put this script into Calendar.app and set it to start at 7.00. When I put script into calendar and ...
1
vote
1answer
391 views

OSX: check for subfolders, flatten directory structure into new folder, then move to desktop

I am in the process of cleaning a huge library of mangas (mostly -but not only- image files). Each manga has a main folder containing subfolders, one for each volume. But sometimes, volume folders ...
2
votes
1answer
3k views

How to open a new Firefox window with URL argument

I am trying to upgrade the existing answer How to open a new Firefox window with Terminal to accept a URL as an argument and open a NEW Firefox window. I can use open -a Firefox ...
1
vote
2answers
3k views

Get path of sub-folder's Parent : Applescript

I want to get the path of a subfolder's parent folder when I drop a folder on a application coded in Applescript So if I drop a folder called 'Test1' which is on the Desktop I want the script to ...
0
votes
1answer
35 views

save multiple tabs to chrome Pocket extenson

I use the Pocket extension to read pages offine on an Ipad, but it's tedious to click the icon for every page. Most of the time I open multiple tabs on one subject. Does anyone have a piece of ...
0
votes
0answers
36 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 ...
0
votes
0answers
27 views

Applescript for Hotspot Shield

I'm trying to build a simple Applescript to control the 'Connect' and 'Pause Protection' buttons in Hotspot shield VPN, but there is no applescript dictionary or menu bars for the programme. Does this ...
1
vote
3answers
3k views

Shortcut for moving an email to another folder in Mail.app

How could I setup a keyboard shortcut for Mail.app in OSX Lion so an email in the inbox, which is still unread, when I use this shortcut is moved automatically to some other previously defined folder? ...
0
votes
2answers
690 views

How to pass AppleScripts display dialog to Growl or growlnotify?

I have this simple AppleScript which takes the text in the clipboard and outputs the amount of words and characters used. What I'm trying to do is passing "display dialog" to Growl or growlnotify. I ...
0
votes
1answer
38 views

In an AppleScript, how do I call/reuse a subroutine from another AppleScript?

snippet 1a on removeText(searchText, sourceText) set prevTIDs to text item delimiters of AppleScript set text item delimiters of AppleScript to searchText set sourceText to text items of sourceText ...
0
votes
1answer
32 views

Batch APPEND (RENAME) a specific keyword to set of files

I have few files namely - "a", "b", "c",etc.. I want to add the keyword: ".mov" to all files in that folder. Please suggest me an approach which script will be best suited for this - AppleScript, ...
1
vote
1answer
95 views

How can I bind scrollwheel to a key in Mac OS X?

I am new to using a Mac, and I have used AutoHotKey applications that rebind the mouse scroll wheel (for example, E = scroll up by 1 mouse wheel "tick" of sorts) to a specific window title, eg. "Game ...
0
votes
2answers
31 views

Batch TRIM (RENAME) a specific keyword from set of files

I have few files namely - "a.mov-, attachment", "b.mov-, attachment", "c.mov-, attachment",etc.. I want to trim the keyword: "-, attachment" from all files in that folder. Please suggest me an ...
3
votes
3answers
1k views

How to update Mac OS X Mavericks desktop background from a script

How can I update Mac OS X Mavericks desktop background from a script? Update Mac OS X desktop background from a script worked up to OS X 10.8, but doesn't work anymore. The desktop defaults to the ...
3
votes
4answers
4k 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 ...
4
votes
3answers
835 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 ...
0
votes
0answers
17 views

Prevent application from detecting screen zoom on Mac OS X

I have an application which streams live television, using a rather expensive portable mobile decoder. And for some reason the company that controls the app has decided to limit the screen size of the ...
0
votes
0answers
16 views

Applescript won't open applications on my external monitor

I'm trying to open a new MacVim window with Applescript, and have found partial success with this: do shell script "cd \"~/code/application\"; ~/bin/mvim > /dev/null 2>&1" This works ...
0
votes
0answers
72 views

Can one show or hide the Mac OS X on-screen keyboard via either keystroke or API?

I would like to show and hide the Mac OS X on-screen software keyboard (fig. 1) with a keystroke, but no actions to do so are available when customizing the keyboard shortcuts via System Preferences. ...
0
votes
1answer
51 views

How can I concatenate multiple clipboard selections in Quicksilver?

I've been using Quicksilver's clipboard module for years but I've always wanted to do this: copy several bits of text. Then paste them as a concat'd list. I found this Stackoverflow post trying to do ...
17
votes
2answers
13k 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 for ...
0
votes
0answers
103 views

disabling password require via applescript freezes Mac

I wrote little script to enable/disable screensaver and password check. Idea is that when my iPhone is near to my Mac (Proximity app checking this), screensaver and password check should be disabled. ...
1
vote
0answers
23 views

Mail.app rules not triggering

I have a mail.app rule set up to run an applescript when incoming emails come in with a certain subject, but it does not trigger. I see the emails in my inbox, and the rule is activated, but it does ...
0
votes
1answer
44 views

Change screenshot default name

How can I change the default screenshot name, to whatever I have written on Preview search tool at the time of the screenshot. As a function on terminal or as a script. Using OS X Mavericks. Thanks in ...
1
vote
1answer
1k 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 ...
2
votes
1answer
46 views

Make alias in a folder to be chosen

I want to make an alias of selected files or folder in other folders, which I want to be able to choose each time from a pop-up window. This was something that was available on previous OSX versions ...
0
votes
1answer
47 views

Request help/advice with my automator/applescript service

I created an automator service that runs a very simple applescript: on run {input, parameters} tell application "Finder" set theFile to selection set theFolder to choose folder move ...
0
votes
1answer
73 views

How can I incorporate an applescript function into Xcode?

So I have a Cocoa-Applescript project, and I am creating an application: I have this script in applescript, it's in automator. set input01 to (input as text) The rest is kinda secret, but I'll ...
0
votes
1answer
366 views

How can I use AppleScript to open a new Safari window on the current desktop space?

I need to open a new Safari window in the current desktop space using AppleScript. NOT move to another space which has Safari running and then open another Safari window. Of course, if Safari is not ...
0
votes
0answers
131 views

AppleScript shows “Document could not be opened. You don’t have permission.” but file can be opened?

I am getting a "The document [filename] could not be opened. You don't have permission" when attempting to access several files in an AppleScript. However, I can open these files manually without ...
0
votes
1answer
102 views

Get path to applescript stored on iCloud

I wrote a shell script which calls an applescript to do some work. The applescript is in iCloud, so I'm manually writing the path to the document storage location... osascript ~/Library/Mobile\\ ...
0
votes
1answer
316 views

How to applescript the 'grab' application

I am trying to write an apple script to use the "Grab" application in the Utilities folder to capture and print an application's window. I can get to the part where I tell Grab to start window ...
1
vote
2answers
191 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 ...
0
votes
3answers
145 views

Process clipboard content on Mac OS?

I want to see if there is a tool or script available that I can use to modify clipboard content on the fly. Often when I'm writing code, I'd like to take a string of text and make it a slug. Instead ...