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

learn more… | top users | synonyms (2)

3
votes
1answer
634 views

enabling/disabling internet sharing with terminal in mac osx 10.9.2

Very much on the line of already existing questions, but not having enough reputation to comment by following existing threads, I can only ask my own, at the risk of duplicating may be, certainly ...
0
votes
2answers
29 views

AppleScript prints out keypresses, doesn't execute them

I expect this script to switch applications (command tab): $ cat hello.applescript tell application "System Events" key code 48 using command down end tell But it just prints out a tab: $ ...
1
vote
1answer
37 views

Difference between variable and pipe to shell in applescript

In answering this question I wrote this script: global presenterNotes tell application "Keynote" activate open (choose file) tell front document set presenterNotes to presenter ...
4
votes
5answers
5k views

Can I download all pictures on a page?

Is there a way I can run a script with a certain web page as the argument that will download all the images from there?
0
votes
3answers
839 views

How Can I Create a Multi-Line Input Dialog using Applescript?

How can I create a multiline text input dialog using Applescript? Creating a single line dialog is simple...
1
vote
0answers
18 views

Is there a way to use automator/write an apple script to change the font in several powerpoint documents?

A recurring issue at work: A powerpoint file needs to be moved in to illustrator and saved as an .eps file. The files are almost always submitted with the font set to Calibri which Illustrator ...
1
vote
2answers
1k views

Applescript giving error 1728 when checking if file exists

I'm trying to make compressing a video file using HandBrake easier through applescript and have been basing most of the code off of templates I've found. At this point in the code, the user has ...
1
vote
0answers
18 views

Creating an Automator/Applescript to compare two versions of an MS Word document

I'm storing MS Word documents in GIT and would like to have an rudimentary document compare system on the rare occasion that I need to diff them. I've seen: ...
1
vote
1answer
25 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
1answer
22 views

Applescript automate double keystroke

I need to emulate a keystroke using applescript for double time shift press. Adding Part of snippet.. tell application "System Events" keystroke shift keystroke shift end tell Even tried ...
0
votes
1answer
34 views

Run an applescript on mouse down

How can I trigger an applescript on mousedown? I want this applescript to run when a user doubleclicks on empty space in the desktop (i.e. not clicking on the icons present on desktop). This is my ...
1
vote
3answers
847 views

Using automator and handbrake cli to convert videos automatically

I am trying to automate video conversion process using Automator and Handbrake CLI version. I am trying to implement the functionality that whenever a video is downloaded in my dropbox folder on my PC ...
2
votes
1answer
33 views

Run an AppleScript that requires keystrokes while the screen is locked?

I've got a very simple AppleScript whose job it is to type some words into a text box. tell application "TextEdit" activate end tell delay 0.2 tell application "System Events" keystroke "Hello ...
0
votes
1answer
765 views

copy calendar entries from one calendar to another via apple script throws error

i am trying to copy ical entries from one calendar to another using the following script: tell application "iCal" set localEvents to events of calendar "Privat" set remoteEvents to events of ...
0
votes
2answers
20 views

Create an automator/applescript service that opens a file in an external program

Just wondering about some automator/applescript help. Basically: I download a MP3 file from an artist (for example) It is saved to my Downloads folder. From there, I want to open it automatically ...
1
vote
1answer
17 views

Get the Sound Output Device Name with AppleScript

How can I get the current sound output device name with AppleScript? For example, in my System Preferences: Sound pane "Internal Speakers" is currently selected. All I need to do is retrieve that ...
1
vote
1answer
43 views

Apps Stuck in Security & Privacy > Accessibility

I was messing around with using AppleScript for GUI manipulation so the apps I was making had to be granted access. The very first one I did showed up in Security & Privacy > Accessibility as ...
0
votes
2answers
71 views

In Applescript, how do I launch Safari “Silently” open url then close the unseen Safari window

I am new to Applescript and MACs although my first computer was an Apple II Plus and I programed in Apple Basic and Assembly. I am using it to create a "Silent" alarm button. We have a system in ...
0
votes
1answer
16 views

Automator Service that works with and without selection

I have an AppleScript that I want to run with a keyboard shortcut. The script uses the current selection of text if it is available, but will also work without it. I have created an Automator Service ...
0
votes
1answer
18 views

Problem With the Click Command - AppleScript

I'm trying to do some GUI scripting with AppleScript but every time I try to use the click command, it will work but cause an error. If I use a try statement it works fine, but I shouldn't have to do ...
3
votes
2answers
510 views

Can AppleScript be used to downloading files from a web page?

I want to write a script that searches a web page for an updated file, then downloading it when detected. There is no command I have found that does this, accept Automator's download URL function, ...
2
votes
2answers
50 views

What's a way to run an automator/bash/applescript command right when a laptop starts charging and right when it stops being charged?

I'm trying to automate running a background application only when my laptop is charging to save battery. So it will launch when I plug the laptop in, and quit when I take it out.
1
vote
0answers
27 views

Can I use AppleScript to upload a file to a webpage open in Safari using drag and drop?

I would like to create an AppleScript to open a specified URL in Safari, login automatically if that would be possible and then upload a file to a form that accepts drag and drop file upload. Would ...
0
votes
3answers
862 views

creating script for ical events from properties of address book entries

I want to create a script that creates alarmed events in ical for birthdays of people that I have in my address book. Unfortunately, I am very bad working with applescript. Below is the outline of ...
2
votes
1answer
684 views

System-Preferences Applescript using osascript cannot select its window

This AppleScript (based on an answer in a MacWorld form) will tell me whether or not Screen Sharing is enabled: tell application "System Preferences" reveal pane "com.apple.preferences.sharing" ...
1
vote
1answer
651 views

need to script connection to telnet and send commands to remote device with no user input

Ok I need some help making a script that will connect to a server and send 2 commands Ideally I would have telnet 192.168.2.230 9993 and once it logs in (no user name or password required - the ...
4
votes
2answers
336 views

Automating ffmpeg using Automator Service

I often use ffmpeg off the command line to convert video files into mp4 on my Mac (running Mavericks). Do note, however, that I am NOT re-encoding my videos; am just changing the container from an avi ...
0
votes
1answer
28 views

Applescript to change desktop image on all monitors?

I have the following code to change the desktop image of my Macbook tell application "System Events" tell current desktop set picture to "/Library/Desktop Pictures/Beach.jpg" end tell end tell How ...
1
vote
2answers
54 views

Open an new Safari window on the current space from the Termial shell with multiple tabs (URLs)

How to open an new Safari window from the Termial shell on the current space? Now when using the open http://example.com it got opened the URL as last TAB on my 1st safari window. I'm looking for ...
8
votes
2answers
5k views

Run AppleScript from bash script

If I wanted to run an AppleScript from within a bash script I could call a file with the list of commands that I require to execute. #!/bin/bash {some commands} osascript file.scpt {other commands} ...
3
votes
1answer
514 views

Hide windows in current desktop (Lion)

I'd like to make a keyboard shortcut that hides all windows on the current desktop, while ignoring windows on other desktops. Is this possible using Applescript?
4
votes
1answer
38 views

How can I restart from an Apple script without warnings?

I wrote this Apple Script to bless my Windows partition and boot to Windows only once: do shell script "/usr/sbin/bless --device /dev/disk0s3 --setBoot --legacy --nextonly " with administrator ...
0
votes
1answer
63 views

AppleScript Error

Edit: Well now it seems to just work. I have no idea what's going on lol. Can someone tell me what's going on here? tell application "Terminal" do script "killall Finder" tell application ...
0
votes
1answer
34 views

Grab the “Active” Window in Applescript

I have a script which perform the following: Load a file into a program (Subler — done separately, not in this script) Confirm the loading of the file (this is where the script begins) Saves the ...
4
votes
2answers
73 views

Applescript File vs Alias

I have these two Applescript commands in which they both point to the same file alias "Macintosh HD:Users:scott:Dropbox:Downloads:AppleScriptFinderGuide.pdf" file "Macintosh ...
1
vote
1answer
1k views

Applescript code to simulate Command and Shift keys

I am handicapped and use Dragon Dictate 3. I need to take control of my Mac with Dragon, because I am not be able to use the keyboard. I need to know some Applescript code to do that. How could I ...
1
vote
1answer
534 views

Opening new Terminal.app window/tab with a certain profile from command-line or AppleScript?

When I login to my Mac, I want to automatically open a new Terminal.app window with a certain profile, say Monitor, that has a startup command and several appearance settings. I thought it would be ...
0
votes
2answers
23 views

Geeklet script to ping hosts

I have found the nice script below to ping a host to check if it is up or down. However I haven't found a way (and my very basic programming knowledge has failed me here) on how I can ping multiple ...
0
votes
1answer
44 views

Using AppleScript to toggle Internet Sharing not working

I am using an applescript to activate internet sharing option from 'System Pref> Sharing'. I work on MacOs 10.9.4. I found this script on a forum and am using it. This works fine, when the System ...
0
votes
2answers
28 views

Set Alias for Terminal Window in Applescript

After opening multiple terminal windows and running commands in them, it becomes difficult to send another command to a specific terminal window. How can we set an alias for each terminal window so ...
1
vote
1answer
41 views

Applescripts not working in Finder since Mavericks

I have a bunch of Applescripts that do things like change sort column in Finder windows, but they've stopped working since Mavericks. If I close and reopen the window, then the change takes effect, ...
2
votes
1answer
849 views

Waiting until a window exists in Applescript?

I'm trying to work with the script below and the repeat until exists window "Print"loop never returns true (I never hear the beep 3). Is this the correct way to wait for a window to appear? I am ...
2
votes
1answer
40 views

Exponential Slowdown of Applescript

So I've been working on a simple AppleScript to try to help with managing my e-mail in OS X's Mail, and I have it seemingly working just fine with one major problem; the performance of the script is ...
0
votes
1answer
28 views

Where does Applescript Event Log go when run under Launchd?

Or, how to log from an AppleScript (saved as application) and/or view the Event Log? None of the AppleScript's log statements can be found. I have tried adding the following to the launchd plist: ...
0
votes
1answer
30 views

How to fix my Applescript plugins for the Contacts application that are no longer available since 10.9 Mavericks upgrade?

I have got 5 scripts listed in ~/Library/Address Book Plug-Ins/ SkypeABDialer.bundle SkypeABSMS.bundle TelephoneAddressBookPhonePlugIn.bundle TelephoneAddressBookSIPAddressPlugIn.bundle Dial with ...
0
votes
2answers
32 views

I want to show a file in an AppleScript bundle, but shell returns: file not found

My Bundle File: reference.txt My Code: set bashFile to path to resource "reference.txt" set the reference_data to do shell script "type " & quoted form of (POSIX path of bashFile) display ...
19
votes
1answer
30k views

How do I automate a key press in AppleScript?

Is it possible to automate the key press of a key (such as "a" or "<") in Mozilla Firefox, Google Chrome or Safari (in this order)? I'd like to automate the key press of "a" for example in Mozilla ...
0
votes
0answers
30 views

Keynote export with AppleScript broken in 6.2

I have recently upgraded both osx (to 10.9.4) and Keynote (to 6.2) and found this script, used to export Keynote presentation to HTML, no longer working. The script is simple: #!/usr/bin/osascript on ...
0
votes
1answer
39 views

Applescript System Events Keystroke broken after 10.9.4

It seems like the recent Mavericks update has broken the keystroke command in applescript -- whenever my script reaches that point, it freezes. (I currently have ~20 zombie osascript processes...) ...
0
votes
1answer
59 views

Converting Automator Action in applescript to bash script

I just wrote an Automator app using AppleScript (along with a couple of bash lines) to start FTP with a single click. However it runs more than a tad slow. Here's the code: set ftpstatus to "off" try ...