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

learn more… | top users | synonyms (3)

1
vote
2answers
60 views

How to pass an AppleScript variable to Perl script?

I have a Perl script that does some text transformation on a given file. Now I would like to call this script from an AppleScript which in turn I could execute from the script menu in order to run ...
0
votes
1answer
69 views

Extract text between two unicode symbols using AppleScript or bash?

My goal is to take text from a standard .txt document, and use (preferably) Terminal or Applescript to extract text between the symbols ▶ and •. While there is only one ▶ symbol there are multiple ...
0
votes
1answer
33 views

In Applescript, search the web

How would I have Applescript display the first one or two options in a google search in a display dialog window? Is there a way to create a functional browser through applescript?
0
votes
0answers
17 views

How can I run a project that I made(within another script), without having to click the icon on the dock?

I made a script that will take user input, and if that input is an application, run the application. This works for all of the preset applications, they all open, and run. For my programs, it only ...
0
votes
0answers
19 views

Applescript applets - can I make an applet immediately if it is already running?

If I make Applet Zed, I can open it again and again with multiple copies running. Can I change this behavior before saving the applet? If not, is there script that can detect the first occurrence and ...
1
vote
0answers
50 views

loop thorough every file in file system with AppleScript [duplicate]

How can I loop through every file in my file system with AppleScrip? And by every file I literally mean every single file, including hidden ones. Can it be done with AppleScript and how? I will ...
0
votes
1answer
64 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
31 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
0answers
61 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 ...
0
votes
1answer
14 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. However,...
0
votes
0answers
19 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
26 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
25 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
2answers
61 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 ...
1
vote
1answer
41 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 ...
0
votes
1answer
33 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 "...
1
vote
1answer
30 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
1answer
47 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 ...
0
votes
0answers
37 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
0answers
47 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
1answer
82 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
50 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
3answers
46 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 currently-...
0
votes
1answer
25 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 ...
1
vote
1answer
31 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 the ...
0
votes
1answer
68 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
91 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' ...
0
votes
0answers
24 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
1answer
59 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
12 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
31 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 ...
4
votes
2answers
81 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
40 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
0answers
26 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, ...
0
votes
1answer
25 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 ...
0
votes
1answer
32 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
34 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 ...
0
votes
1answer
44 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
1
vote
0answers
22 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
0answers
18 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 *...
0
votes
1answer
43 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 didn'...
0
votes
1answer
18 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 {subject:...
0
votes
0answers
38 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, ...
1
vote
3answers
147 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
25 views

How to cd into my local git repo from an AppleScript?

I am running a Mac using OSX Yosemite v10.10.5. I want to push my local git repo to my remote using AppleScript. So the git code would be: shell git init git add README.md git commit -m "first ...
1
vote
1answer
50 views

Set a Display colour profile via Terminal or AppleScript? (Macbook)

I would like to be able to change the display colour profile of my MacBook, with a view to writing a program that changes the loaded colour profile on a shortcut key-press, or automatically at certain ...
0
votes
0answers
16 views

Problem with AppleScript and ffmpeg

First, say I'm new to programming. I'm trying to make a script to encode a selected video. The problem is that this script allows me to select videos on the desktop but if I select a different path ...
1
vote
0answers
41 views

The process of making custom notifications, iOS GarageBand, iTunes database, iTunes file format, AppleScript

I'm developing an iOS and Android app which uses custom notification sounds to provide users with step-by-step instructions. I've recently stepped through a pretty messy process of creating these ...
0
votes
1answer
34 views

AppleScript : Dim brightness below factory setting

I want to dim the script below "0" on my iMac. Here is my current script, but this stick to OSX settings. try tell application "System Preferences" reveal anchor "displaysDisplayTab" of ...
0
votes
1answer
31 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 ...