AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

0
votes
1answer
138 views

send applescript a url ,if the url file's extension is “.mov” download it to desktop

I'd like to remote control my mac mini(using as a NAS with Mac OS X 10.8.2 Server)download files from URL. I think applescript can realize it. So I'm puzzled by two problems: 1.How can I send URLs to ...
0
votes
2answers
370 views

Applescript to get name with VLC 2.0 should work but doesn't

I'm trying to get the name of the current file playing in VLC. Applescript SHOULD be able to do this with VLC 2 and on (it's in the dictionary, "name of current item") however it keeps not compiling, ...
3
votes
1answer
389 views

AppleScript based Automator service quite unstable (sometimes very slow, sometimes encounter error)

I have some applescript based Automator services, for instance, Launch Emacs With Selected File: tell application "Finder" set selectedDirectory to (quoted form of POSIX path of (target of window ...
0
votes
1answer
420 views

Applescript to play Windows share (smb://) videos with VLC Player

I'm building a script to automatically run videos held on a windows server using VLC. I can get VLC to play files on my drives, but not from files held on a server. For example: tell application ...
0
votes
2answers
2k views

Can AppleScript/osascript be used to click menu extra menu items?

I have an application installed that only appears in the menu bar (as a menu extra to the right). I would like to click one of the items contained in its menu via osascript. I've found the following ...
1
vote
2answers
413 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
1answer
167 views

Applescript to execute script in new terminal window and maintain a reference to that window

How do I use applescript to execute a script in a new terminal window and then close the window? After the line: set x to do script "" Is there a way to get a reference to the window of tab x? A ...
0
votes
3answers
1k views

How to open a new tab in Chrome using AppleScript, only if it doesn't already exist?

I'm trying to write a little AppleScript to make a new tab in Chrome only if it doesn't already exist. I tried the following: if title of tab is not "Gmail" then open location ...
0
votes
1answer
3k views

How can I set a static IP, gateway, net mask, and dns using terminal / applescript - OS X 10.7.5

I use my macbook at home and at work. At work I need to use a static IP, gateway, DNS and net mask. At home I use it in DHCP mode. Manually setting them every day really sucks. How can I set them ...
1
vote
1answer
255 views

OSX script to Check if ffmpeg process has stopped

I have a Automator Workflow that uses Videobox to convert flash videos for multiple devices but cannot tell when it finish a conversion,I know that it uses ffmpeg for its conversion as I can see it in ...
1
vote
1answer
453 views

Applescript to shell script watch folder

I am trying to setup a watch folder so that when a file is added to a folder, I can run a shell script...for this purpose I made a simple test but cannot make it work... Here is my applescript on ...
1
vote
0answers
283 views

Trying to re-direct emails as plain text using Applescript. Code (inside) isn't working, any help would be great

I have users sending mail through Outlook which formats the text as Rich text. I'm trying to create script where a "catch-all" email address intercepts the email, converts it to plain text then send ...
3
votes
1answer
2k 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, ...
1
vote
1answer
97 views

Automating steps required to disconnect my laptop form my desk

I have a MacBook Pro, and when on my desk it is connected to a thunderbolt display. And I have an external hard drive connected to my thunderbolt display. This hard drive has 2 partitions and ...
0
votes
1answer
177 views

mount disk with password from applescript

I'm using a applescript to mount my harddrive. At the moment im using: do shell script "diskutil mountDisk diskutil list | grep \"Harddrive\" | grep -o 'disk[0-9]*'" Now i want to do the same but ...
2
votes
2answers
305 views

AppleScript to return recent Finder folders as list

I need to write an AppleScript that will return me a list of the Recent Folders menu in Finder. I don't want an AppleScript that will simply open this menu – I need a script to return the recent ...
1
vote
1answer
218 views

iTerm 2 change row size using AppleScript

I want to change the height of my terminal window using a script. Currently this is what I have come up with: tell application "iTerm" activate tell the current terminal tell the ...
6
votes
2answers
4k 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" ...
0
votes
1answer
255 views

Applescript in Automator to Service

I'm trying to do this very simple Applescript for text manipulation. It runs from the service menu, in some applications. Questions: What's wrong with my script? Sometimes it shows up in the ...
0
votes
2answers
105 views

Scripting a sequential workflow in OSX

I currently have a workflow which relies on several bash commands sequentially in the OSX terminal. It is basically a process which starts with a file x.csv, it does an operation on it and generates ...
4
votes
4answers
3k 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
1answer
2k views

Only get the size from “du” command, not the folder names

I am doing an applescript that is supposed to set the size of an folder to an varible. This is the code so far: set sizeVar to do shell script "du -skh -m /Users/JS_Admin/Desktop" Output: "4242 ...
2
votes
4answers
414 views

How can Automator or Applescript rotate 500,000 images in folders and subfolders?

I have very specific question. I've got 500,000 images that sit in 98 subfolders. Some of the subfolders contain 25,000 images. Is there any script/automator workflow that I can use? I was trying ...
1
vote
1answer
45 views

I would like to know if someone has applescript to loop al my stickynotes and put it in a textfile

I have been meaning to do this for a while, but I never got around to do it. The problem is that I have to do research how applescript works. Anyway, I have now collected over 200 snippets for my ...
0
votes
3answers
991 views

AppleScript: how do I store folders' pathnames into an array, replacing spaces with “\ ”?

I have a folder and inside this folder there's a bunch of subfolders. Using AppleScript I wish to store the pathnames of these subfolders into an array. Here's my problem: each pathname containing " ...
2
votes
1answer
2k views

Use Automator to open shell script, see output in terminal

I have a fun little problem, running on Mac OS X 10.8 Mountain Lion. I have a script (WebKit's run-safari) which launches Safari in dev mode (it sets some environmental variables and then runs arch ...
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
507 views

Can I use applescript to click buttons in background?

Sorry for this generic and probably bad-written question. I've never programmed in applescript, but I'm quite familiar with other coding language. I'm in the need of clicking on 2 sequential button ...
4
votes
1answer
3k 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 ...
1
vote
1answer
277 views

How to lock OS X after autologin with a script

I want to lock my Mac running OS X 10.8 after it has powered up with a script. I have autologin enabled.
2
votes
1answer
176 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". ...
1
vote
2answers
2k views

Close all Mac Terminal windows, but the one running a script

I am trying to create a shell script that runs a python simulation programing in 4 terminal windows. I have the script that launches the program four times in four separate terminal windows(total of ...
2
votes
1answer
439 views

Applescript Woefully Slow Finder.app Set Comment

This is the script: set d to do shell script "date +%d-%m-%Y" tell application "Finder" set dir to POSIX file ("/Volumes/Xsan/PathTo/Folder") as alias repeat with f in entire contents of ...
0
votes
1answer
492 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 ...
2
votes
0answers
95 views

Applescript Adobe Updater

So, I am new to Applescript editor and I am trying to write code to automatically update computers. For some odd reason I can not seem to get Adobe to update successfully. I tried using Accessibility ...
5
votes
2answers
6k views

Make AppleScript wait for an Application to finish loading

I have an applescript to initiate my work environment, but have a small quibble with it. I want the script to launch several programs, and then hide them, once they started. The code looks like this ...
3
votes
0answers
787 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: ...
2
votes
2answers
7k 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 ...
2
votes
2answers
691 views

Automating tasks in OSX like VPN Connection?

I am using my school's VPN service to surf on netflix. I have to connect to the VPN most of the time. My school uses Cisco AnyConnect Secure Mobility Client. I have to enter password and accept a ...
2
votes
2answers
467 views

AppleScript to logoff Mac user after closing an application?

I've configured a local user account on an iMac (Lion) to immediately launch Firefox to a specific page after logging in – the page contains a survey to be completed by the user. This works fine. ...
4
votes
1answer
4k views

How can I launch Finder in a specific directory, from Automator or AppleScript?

I'm trying to assign a global keyboard shortcut that will launch a new window of Finder, in a specific directory. I can write a script that'll open a new Finder, but not sure how to make it open in a ...
1
vote
1answer
2k 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 ...
2
votes
3answers
3k views

AppleScript to paste clipboard into current application

I thought this would be simple... I want an AppleScript that launches Plain Clip and then pastes the clipboard into the current document where the cursor is. My script launches Plain Clip (a ...
3
votes
1answer
2k 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 ...
0
votes
1answer
532 views

How to avoid password prompt when I “Put Back” a file from the trash, via AppleScript?

I accidentally moved over 4,000 files to the trash, and I want to move the files back to their original locations. While the Lion supports this feature (via the Finder's "Put Back" command), it will ...
3
votes
1answer
252 views

auto-create symlink to currently inserted DVD

Is it possible to use applescript or a shell script to automatically create a reference to the currently inserted DVD? If I pop out Midsomer Murders DVD and insert Star Trek, the Wrath of Khan, the ...
3
votes
1answer
783 views

How can I run an AppleScript or shell command on Mac OS X at screen unlock?

Note that this is not the same as startup or login. I never log out of my machine and I want to run the script whenever I unlock the machine to start working.
5
votes
2answers
2k 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
517 views

How to bring an application to front based on some condition (OS X) with AppleScript

I'm trying to find a way to automate bringing a web browser to the front (ie - give it focus, make it visible on the screen) based on an event that happens in a web page. I have full control over the ...
0
votes
1answer
4k views

Running a command line app with sudo and password automatically on OS X startup

I need to run an app at startup/login on my mac. I want it to launch in the background and start doing it's work without interrupting me or me having to start it up because I invariably forget and ...