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

learn more… | top users | synonyms (3)

0
votes
0answers
5 views

Improve applescript to open New Private Window with Safari

I made this AppleScript to use with the script tool. It can be saved as the application to launch from a click. I have to approve the application though in the Security edit tool. This open the ...
0
votes
0answers
8 views

How to add all *.m4v files from certain folder to playlist in iTunes with automator/applescript?

There is a folder on Mac. There are a lot of files in it, but i want to make an automator/applescript script, which will watch this folder and if it will see any new *.m4v file in it, it will add it ...
0
votes
1answer
25 views

getting a color value of a specific point on screen

How can I get a color of a specific point on screen with Apple Script? I would give the point in pixels such as {120,400}. Should I use an external app and "tell" it to find color value of some point ...
0
votes
0answers
15 views

Attach file to Outlook 2016 email using AppleScript

I am attempting to attach a tar.gz archive of system logs to an Outlook 2016 email that gets created from another shell script. The script was modified from this one at JAMF Nation. Because the file ...
1
vote
2answers
32 views

How can I switch to an open tab in Safari using osascript?

Trying to switch tabs in Safari with osascript. I have tried multiple versions of the following: osascript -e 'tell Application "Safari"' -e 'keystroke "2" using command down' -e 'end tell Tried ...
0
votes
0answers
7 views

Applescript character count in words with combining diacritics

If I combine an acute accent with, say "x", with a w before it and a y following, like this: "wx̀y", this will look good in BBEdit and Word, and both programs will give a character count of 4. ...
0
votes
0answers
14 views

How to make an AppleScript app open another one?

The title says it all. What would be the line of code to open a specific app created in AppleScript? tell application "userappname" to open/launch/what? What would be the last piece of the code? ...
0
votes
1answer
13 views

How to remove the last character of a string if I know what the character is in AppleScript?

So basically I was messing around with AppleScript and created a variable based on the app's path and it always has a forward slash at the end that I don't want. See my other question for more info. ...
0
votes
1answer
18 views

AppleScript without showing what program it opened and edited

I wrote an AppleScript that goes into System Preferences and clicks on some of the buttons. I does that by literally opening System Preferences and clicking UI Elements. I'm wondering, is it possible ...
1
vote
1answer
19 views

Paste text with AppleScript without simulating cmd-v with System Events

I would like to be able to use AppleScript to paste the clipboard's text into the foreground application. Every solution I can find online uses tell app "System Events" to keystroke "v" using command ...
2
votes
2answers
3k views

Open a new Safari window in the current Space from Terminal with multiple tabs (URLs)

How to open an new Safari window from Terminal in the current Space? Now when using the open http://example.com command it opened the URL as last tab on my first Safari window. I'm looking for a way ...
0
votes
1answer
24 views

get radio buttons in System Preferences

I am trying to click at radio buttons in Displays panel of System Prefernces. This is the code I use to identify radio buttons: tell application "System Preferences" activate reveal anchor ...
0
votes
1answer
16 views

change screen resolution with AppleScript

How can I change change screen resolution using AppleScript? If AppleScript can't do it, what about Terminal? I tried with examples at How to set screen resolution with a keyboard shortcut on Retina ...
1
vote
1answer
24 views

How to make an AppleScript app locate itself?

I've been messing around with this cool AppleScript scripting language and I have yet another question. How to make an AppleScript app locate itself?Like something like this (that obviously doesn't ...
0
votes
3answers
37 views

Easiest way to get path of currently-opened file in Adobe Acrobat?

When viewing a file in Adobe Acrobat Pro XI on OSX Yosemite, I sometimes want to send the file to another application. To create an action in KeyboardMaestro, I need to get the path of the ...
0
votes
0answers
25 views

Automator Services to transform text to Upper, Lower, and Sentence Case

What's the appropriate code to create Automator Services to transform the selected text to: Lower case Upper case Sentence case For Upper case this answer doesn't seem to work. I get this error: ...
0
votes
1answer
19 views

Why is AppleScript not ejecting my volume?

I have a hard drive in my mac with multiple partitions, and I want to eject some of them with AppleScript. Simple: tell application "Finder" eject disk "Photos" end tell Except it does not ...
0
votes
1answer
25 views

How to quit “Force Quit Applications” using AppleScript?

I've been learning lots of different programming languages when I came across AppleScript. Since I'm technically new to it, this question may seem dumb.I need an AppleScript script to quit the "Force ...
0
votes
0answers
22 views

Get result of Terminal tab do script via commandline

I've seen similar questions like this but none seem to deal with getting the result from a specific Terminal tab? I'm writing a Chrome extension to do some awesome stuff. Right now I'm just trying to ...
0
votes
1answer
27 views

unlock external locked encrypted disk with applescript command by filling dialog box to cracking password by force brut

I make a terrible mistake. I totally lost my paper with the secret password for my encrypted external GUID hard drive. This external drive contains many pictures but also some works documents very ...
1
vote
1answer
22 views

Can someone help me to translate this automator workflow to applescript?

What I want to do is select a bunch of images with varying dimensions and uniformly apply a percentage scale to resize them. The workflow comes very close to that. But I cant get more specific to ...
0
votes
1answer
2k 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 ...
1
vote
1answer
44 views

Automator: “Run Shell Script” throws error because of missing “on” command

OSX 10.11.4 here. I'm trying to create a workflow for use with a hotkey, to run a simple shell script. Created via: Automator -> New Service -> Utilities -> Run Shell Script, then set to 'no input' ...
4
votes
3answers
5k views

Using applescript to lock screen

I need an applescript which locks my Mac in the same way pressing "shift"+"ctrl"+"eject" would. I tried two different approaches, but both failed. The first one was to search the internet for a ...
0
votes
1answer
21 views

make “fit to screen” default window size in Quicktime

How can I make Quicktime to always open in Fit to Screen option (available at View->Fit to Screen)? It doesn't seem to remember the last window size. Is it possible to attach a script to a program, ...
0
votes
0answers
22 views

I need help with an AppleScript!

So after I transitioned to Mac, I found myself in a need for a script. Something similar to what I used with AHK on Windows. I would need a script that would spam Space multiple times, but only when ...
0
votes
0answers
11 views

Notify me when someone joins messages

When one of my contacts is using the Messages app (OSX 10.9), a blue dot appears next to their icon to show that they are available. Is there a way (probably using applescript or automator) to make a ...
1
vote
1answer
24 views

get name of file from file path using AppleScript

I am trying to get the name of file using AppleScript with the following code: tell application "Finder" set filename to name of "/Users/mainuser/Desktop/Test/shot.png" // should return shot.png ...
0
votes
0answers
37 views

How to create a service which starts an app without opening a selected file?

I'm trying to create a service, that opens an app (Terminal app). I created it with Automator. I selected "folder and files" and "finder" in the right-side menu. Since there doesn't seem to be a ...
0
votes
1answer
21 views

Open programs at random time with applescript

I was wondering how I can make a harmless "fake" virus to prank a friend. I am using Applescript Editor. The prank is going to open Safari at any random time. I know how to open Safari with ...
4
votes
2answers
68 views

change download folder based on website from which I download

Is it possible to change Downloads folder in Google Chrome (or any other browser) on the fly, based on the website from which I download? Example: I start downloading on facebook.com and it downloads ...
0
votes
0answers
17 views

How to have a script restore a desktop spaces default setup (as defined in the script)

Noob here so I might be asking the wrong questions... I'm on El Capitan and I tend to create and dump desktop spaces on the go. I've been trying to write a script that cleans op the Spaces situation, ...
3
votes
1answer
89 views

Can't Set Desktop Background in Fullscreen App

I have an 11" Air so I usually run all of my open applications in fullscreen mode. I have a launchd job for my user that runs a script every hour and every login to set the desktop background ...
1
vote
0answers
18 views

How to get location on HDD of dropped webloc files? [closed]

I need to get the file path on the local drive of where a dropped (or several dropped) .webloc files are located. I have already encountered and understand that when dropped on an Applescript Droplet, ...
0
votes
1answer
22 views

Automator/Applescript using Tags

I need an Automator/Applescript to move a file to a certain folder based on a specific tag it contains. The input would be the file. Anybody have any ideas? TIA, Jake
0
votes
1answer
28 views

Move Application from Dock to Menu Bar

I have written an AppleScript application and when running, it appears in the Dock, however I would like it to have it in the menu bar, at the top of the screen, instead. How can I achieve this? Is ...
0
votes
1answer
28 views

update git repository with apple script

I want to update my git Bitbucket online storage with apple script. This is the code that works in Terminal, but not when i run apple script. cd /Users/mainuser/Desktop/Projects git add -A git commit ...
2
votes
1answer
2k views

Adding Bounce Message back to Mail in Yosemite

Does anyone have an updated version of this workflow for adding a Bounce Message feature to Apple Mail in OSX 10.10.3? Applescript: on run {input, parameters} tell application "Mail" ...
0
votes
0answers
13 views

Select multiple UI Elements from an Apple Script

I´m writing a script to facilitate some workflows within FCPX. In there I have to select multiple UI elements (rows) in a table (the Event browser). I found select *element* and set selection of ...
1
vote
0answers
128 views

Get posix path of .webloc in applescript droplet

If a .webloc is dropped onto the following script, the dialog won't be displayed; instead the url of the webloc is opened in the default browser. on open dropped_webloc display dialog "hey" end ...
4
votes
3answers
2k views

Emulating associative arrays in AppleScript

A problem that would be trivial to solve with key=>value pairs. For each item in list_a, find the matching item in list_b and compare a single attribute (calculate scale ratio for two sets of images). ...
0
votes
1answer
32 views

Use caps-lock to lock fn key or other way to lock fn key?

What I want to achieve is simple: caps lock on = fn locked (use function keys). caps lock off = fn unlock (use media keys). I found a couple of topics around this problem, but their solutions ...
1
vote
1answer
1k views

Repeated keystroke “w” for Agar.io

I've been searching for the relevant articles on the Internet and found nothing useful. Maybe I'm too stupid to understand. I would like to create a script that automatically keep pressing the "W" ...
4
votes
4answers
6k views

How to open a new Terminal tab in current working directory?

I want to create and run a bash function that: cd into a project's directory Open a new tab in Terminal in the same directory Open my dev tools and start dev services Item #2 doesn't work as ...
0
votes
1answer
15 views

Is it possible to activate whichever mail client is connected by default to a mailto link in applescript?

So I have an apple script that sends an email via the mail app. I didn't make it myself though. tell application "Mail" set newMessage to make new outgoing message with properties ...
0
votes
0answers
16 views

How can I use Applescript to repeat an iMacro in Firefox 8 times?

I have an iMacro created in Firefox that needs to be repeated 8 times to function properly. How can I automate the playing of the iMacro 8 times with Applescript? I've tried recording my workflow, ...
0
votes
1answer
17 views

In Applescript, how do I get a line number or stack trace on error?

I'm writing some fairly complex Applescripts, but when something goes wrong - Apple event timed out - or similar, I can't tell precisely where it failed. At the moment, I'm wrapping all handlers with ...
1
vote
2answers
2k views

AppleScript To Manipulate VLC

I want to do a script, that it can launch VLC player, and in VLC player "Open a file", then "Select a folder", then click on "add" then "play" it. I think that Automator can't do this. But ...
1
vote
3answers
79 views

How to run a shell script from an AppleScript?

I am using a Mac running OSX Yosemite v.10.10.5. When I try to run my shell script from my AppleScript, I get the following error message: Error message at AppleScript Script Editor error "sh: ...
0
votes
1answer
53 views

Use AppleScript to send all emails in a folder at a certain time

I'd very much like to please develop an AppleScript to send all emails inside a specific mailbox whenever it is run. Then I can create a mailbox called "9AM", place emails inside there, and with a ...