AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

1
vote
1answer
38 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
591 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
1k 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 ...
3
votes
1answer
1k 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 ...
2
votes
1answer
336 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 ...
2
votes
1answer
112 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
763 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
304 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
2answers
2k views

Sync an iPhoto library with specific folder(s)

My aim is to sync all files that I add to a specific album in iPhoto 11, to a folder on the Mac. I will then use cron & rsync to shovel the files to a gallery server. Now, I did find the How to ...
2
votes
0answers
82 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
3k 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
479 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
2k 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
1answer
439 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
1answer
172 views

Set file creation date by reading modified date

How can I set a file's creation date as the modified date? e.g. File is made on Monday, edited on Tuesday. On Wednesday I want the date modified and date created to be set to Tuesday. Thanks!
1
vote
1answer
2k 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 ...
0
votes
1answer
709 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 ...
3
votes
1answer
181 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 ...
0
votes
1answer
404 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 ...
2
votes
3answers
931 views

Get a list of all files and their attributes on OS X

What is the best and fastest way to get a list of every file on OS X including hidden and system files along with their attributes? I'm not afraid of the terminal or scripts, but if there is a ...
28
votes
6answers
26k views

How to find my stolen Macbook

A friend of mine just had her Macbook stolen. Her Dropbox account is still working on the Macbook, so she can see each time the Macbook comes online, and she can get its IP address. She has given ...
3
votes
1answer
524 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.
4
votes
0answers
885 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
352 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
3k 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 ...
2
votes
0answers
225 views

Script to join WPA2 Enterprise wifi

When I head to work with my MBP running OSX 10.7, I have to go through this series: Join Other Network Enter SSID select Security = WPA2 Enterprise generate a pw via my RSA soft token Join ...
2
votes
1answer
710 views

How to open a new Firefox window with Terminal

I am running Firefox v10.0.1 with OS X Lion v10.7.3 From the Apple dock, you can right-click on Firefox icon and choose NEW and a new Firefox window will open. From terminal, I have tried open ...
1
vote
1answer
1k views

Is there a good utility for resizing application windows to preset sizes in OS X?

I've been using the Better Touch Tool and Right Zoom to be able to maximize windows to full screen, and to resize windows to the center, or top right / left quarter of the screen. Those apps are ...
0
votes
2answers
642 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
2k views

How to zip multiple files into separate archives?

I admit this question was asked here before: Like Zip into separate files where the person who asked didn't specify the OS he used and received no answers. I need to separate a huge directory ...
0
votes
2answers
150 views

How to smart delete all files of a folder and back-up file details on Mac?

I'm looking for a way to delete all files of the Downloads folder with a shell script or applescript that is run on a daily/weekly basis and most importantly backs up all of the file details, except ...
3
votes
1answer
366 views

iCal AppleScript, how to specify 'the same day at 9'?

I know that I can define a new iCal event programmatically, by means of AppleScript, defining something like: tell application "iCal" tell calendar "My Calendar" set theCurrentDate to ...
3
votes
1answer
353 views

Way to switch F keys to 'application' keys and back on mac via terminal? (10.6)

Is there a command I can issue via terminal to switch my F1-12 keys to being application keys (media, screen brightness ...) and back? i.e. replicate toggling System Preferences => Keyboard => ...
4
votes
1answer
2k 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
1answer
186 views

How can I hide the Box SimpleShare preferences pane when the app starts?

I have set the Box SimpleShare app to start at login, but the app launches its preferences pane right after it loads its icon in the menu bar. Setting it to start in “hidden” mode in System ...
4
votes
1answer
441 views

Mail.app: Showing remote images automatically for specific senders

In a similar way to what gmail allows, I'd like to get specific senders' remote images to be auto-loaded. One option that I came across is using a rule and an applescript: ...
1
vote
1answer
209 views

Change Pseudo-Function Keys to Show/Hide Application

On my macbook air, the F5 key is un-assigned. So in Sparrow I set that key to hide/show Sparrow. Basically I have a dedicated F key to look at my inbox then hide it again to go back to my work. My ...
0
votes
1answer
312 views

Applescript Proxy

Ok. So I am having a little trouble getting an apple script program to work. Basically, I have a text file named Proxy.rtf and I need an applescript that grabs line one from this text file and changes ...
1
vote
0answers
124 views

Add a contact from an email address within email text

I came to Office/Outlook 2011 from Mac Mail, and now I find that I'm unable to do something that I need to do ALL THE TIME. In Mail, if there was an email address within the text of an email message ...
1
vote
2answers
698 views

How do I escape a slash in AppleScript?

How do I escape a slash in AppleScript? The documentation seems to suggest that set target_string to "\\" should return a single \, but in fact it returns \\\\. On the other hand, set ...
1
vote
1answer
1k views

How to get QuickTime Player 7 to save its export settings?

I'm trying to get QuickTime Player 7 on Mac OS X 10.6.4 to save its export settings so I can batch convert some MKV movies to M4V (MPEG-4). I've already exported a movie using the settings I want. ...
0
votes
1answer
59 views

Execute Script when leaving a window

is it possible to execute a Script (Applescript/Shellscript) when I leave a window (and when I switch back to it)? What I want to do: I want to pause my VM when I leave the VM-Window (vmrun pause ...
0
votes
1answer
537 views

Automate subject in Apple's Mail.app

At the company I work with, we use [client-domain.com] prefixes before the actual subject line of emails as kind of a rough tagging system. Is there any way that one could automate this so when I ...
9
votes
2answers
401 views

Prettier text dialogs in OS X scripts

I'm getting pretty sick of these default AppleScript and cocoaDialog dialogs: I'd like to replace them with something closer to this: Has anyone made a shell executable like cocoaDialog with a ...
1
vote
1answer
1k 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. ...
2
votes
1answer
531 views

How can I get Automator to open a URL in the current Safari tab?

My current code involves a "Watch Me Do" block recording a ⌘ W keystroke and then opening the new URL, but that's kind of kludgy. Is there any way I can use Automator to open a URL within the current ...
0
votes
2answers
270 views

OS X switch to single monitor mode?

I have an extra monitor hooked up to my iMac running Snow Leopard. This additional monitor is also used by my linux box, so I occasionally switch to VGA mode when I need to use the linux box. My ...
1
vote
3answers
5k views

Execute applescript without open the editor

Every time I want to run an applescript the editor pops up. Is there a way to run it directly?
0
votes
1answer
144 views

Automator Workflows How

I'm trying to follow the instructions here http://snowleopardtips.net/tips/everything-you-need-to-know-about-screen-captures.html under "Installing the Folder Action." First it suggests a folder I ...
2
votes
2answers
3k 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 ...