Questions tagged [applescript]

AppleScript is a proprietary programming language in macOS to control and exchange data with applications.

284 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
129 views

Run Automator script when new files are added

I'm trying to make an automator script to import photos in Photos.app that are in my DropBox folder. Nothing spectacular you'd say - true. But I can't get it to work. On a change in the folder, the ...
1
vote
0answers
2k views

Curl terminal command syntax from Applescript

I want to execute a curl command in Applescript that does the following (per this SE question/answer): https://superuser.com/a/1054803/471181 ...Do an HTTP POST of the contents (as a string) of a ...
1
vote
0answers
450 views

How to define keyboard shortcut for “Save to your Music” Functionality for Spotify

I really love the Spotify app. When I like some songs on Spotify, I'm using "Save to Your Music" to add songs to my Spotify library. But this requires switching applications and using the mouse, so I ...
1
vote
0answers
472 views

Script to start my VPN if I'm connected to a specific Network / SSID [El Capitan update]

I'm searching an AppleScript to automatically start my University VPN if I'm connected to the University network. I already found some solutions for older OS X Versions, but they're not working ...
1
vote
0answers
137 views

Copying a path of the app to a new directory?

I was wondering if someone could help me make an AppleScript that copies the app the script is into another location. So, this is what I tried... (Please don't say anything since I am new at ...
1
vote
0answers
1k views

Error executing AppleScript through Launchd - “Service could not initialize”

I've written an AppleScript that turns our CenturyLink modem's wireless radio on or off. It works when I run it manually with osascript, but now I'm trying to get it set up on a schedule with Launchd. ...
1
vote
0answers
328 views

AppleScript to extract email address from body of email and send auto response?

Is there a way with AppleScript to extract a contact link in the body of an email and send an auto response with apple mail? (I'm running Yosemite) I would like to auto respond to leads I receive ...
1
vote
0answers
551 views

I need to batch move files from one location to another, and put them in pre-existing folders with the same first 7 characters

I am looking to automate moving large amounts of files. Basically I have one location on our network full of .zip files. They are all named like "12-3456.zip" etc. I need to move each of these .zip ...
1
vote
0answers
286 views

OSX Flush DNS without sudo

I have a Mac that keeps messing up its DNS (this may be a wider network issue, we have windows clients that are having problems too). Whilst I try to understand the DNS issue I'd like to set an 'icon' ...
1
vote
0answers
889 views

How to: Automator, launch an app, as if I dragged n dropped file on App's dock icon?

Using automator, I know how to "Launch an App". I would like to know how to "Launch an App in a specific way". The app I want to launch, acts differently depending how its launched. If one: clicks ...
1
vote
0answers
43 views

Forcing application to go to selected window on startup

I run a multi-monitor set-up on a single "Desktop". All of my applications when opened run on the primary monitor, which is the smaller monitor. I would like to have some (e.g. browser, mail client) ...
1
vote
0answers
491 views

Automount afp Volume with AppleScript

I know this is similar to other open questions about mounting network drives, but this one is slightly different. I have an AppleScript that runs at startup that looks like this: tell Application "...
1
vote
0answers
70 views

Filling areas of Json script with user prompts

I am wanting and Applescript to fill certain parts of a Json script via user input prompts, but not sure how to place the results in the correct areas? And to then have the result copied to the ...
1
vote
0answers
458 views

How to execute javascript from an applescript (Yosemite)?

Since Yosemite, the Script Editor allows using javascript. What is the best way to execute javascript from an applescript? My use case is an existing applescript which needs to send some parameters ...
1
vote
0answers
986 views

Add local file URL handling to Applescript Application

I am using a simple applescript application to open different URL schemes in different Fluid Apps. By setting this app as the default browser, I can effectively parse out the URL scheme and open the ...
1
vote
0answers
1k views

AppleScript auto Email attachment save

I am looking for an AppleScript, that simply uses an email defined by the "Mail Rules" and extracts the attachment to a specific folder. I found different codes, but they all didn’t do want I want. I ...
1
vote
0answers
1k views

Automator or Applescript for custom script to download bank statements?

What's the best tool to script to automate downloading statements from my bank and credit card companies' website in each of their statement download area? All banks, credit card companies, and ...
1
vote
0answers
132 views

Third party apps can't call applescript that otherwise work in 10.9

I am invoking my apple script from third party executable(C executable). Here is the applescript: on run argv do shell script ("open -n /Applications/Test.app/ --args " & "'" & item 1 ...
1
vote
0answers
60 views

Automatically reduce MacBook brightness on connecting to external display?

I would like my macbook to reduce its screen brightness to zero when I connect it to an external display. I know there's no such setting, but how would I go about writing a script that would do that? ...
1
vote
0answers
160 views

How to prevent AppleScript confirmation from appearing when using Quicksilver trigger?

When I launch this simple AppleScript from Finder or by using the standard Quicksilver panel selection, it runs without confirmation. tell application "Flux" if it is running then quit ...
1
vote
0answers
953 views

Disable copy/paste for an OS X application

I would like to disable copy/paste for an app to protect sensitive information displayed in it. I don't have the app source code. I'm already aware of this general solution: https://superuser.com/...
1
vote
0answers
375 views

Script to make the x red button kill the app

Quick background: new mac, long time windows user; not scared by linux and scripts. I am currently using RedQuits to make the x red button quit de app, not just close the window. It is a great ...
1
vote
0answers
242 views

Can I find and replace Core Text/Cocoa text strings in any application?

My scenario: I use an app called Antetype for UI design. Antetype uses OS X-native technologies for text rendering (it uses the system-standard text palette). Antetype does not have a find and ...
1
vote
0answers
1k views

Can a new mail be sent using AppleScript + Outlook + IMAP?

I'm trying to use apple script to automate creation of a new outlook mail message. The below code will work when I have my email account sent up as pop3 but I need it to work with an IMAP account. ...
1
vote
0answers
191 views

Touching files in correct order

This code touches files in alphabetical order. I need to touch files in order it is in list_of_files, so first it touches file2, then file3, then file1). Is there any other way to do this than to ...
1
vote
0answers
802 views

How do I tell Finder to read the network folder contents?

I use the following AppleScript script to automatically connect a remote drive when my VPN connection is established using Viscosity: do shell script "sleep 5" tell application "Finder" mount ...
1
vote
1answer
28 views

Count pages in a folder full of .doc files

I recently found this very helpful link to count the pages in a large folder full of PDF files: Count pages in PDF (for non-technical, mac using person). It worked like a dream. Now, however, I need ...
1
vote
1answer
291 views

Is there a hook for triggering scripts when a particular notification is displayed?

I'm trying to set up some system behaviors to occur when particular iCal or GCal events begin and end. Is there a way to hook into the notifications system (e.g., via a LaunchAgent) to make the Mac ...
1
vote
1answer
314 views

How can I control the Terminal in the current space with AppleScript?

Working on building a Handler that passes the terminal window then calls the ID for a script I've run into mixed results and I'm curious if there is a cleaner way to get window 1 The handler: on ...
1
vote
1answer
375 views

Detect when an application goes fullscreen?

I would like to detect that event from an Applescript. I have found the lsappinfo command-line app, which has a listen command that seems to fill my need exactly, but going fullscreen does show up in ...
0
votes
0answers
7 views

osa script to get user input with if condition

I want to run osa script to run in self-service application. first this line needs to be displayed: osascript 'tell app "System Events" to display dialog "Save and close all your files and ...
0
votes
0answers
21 views

Applescript service which utilises “on idle”?

I have been trying to run a script on a recurring basis via an apple service. Most answers I have seen have been are for 'stay-open' apps - whilst this possibly works as a solution and I have glanced ...
0
votes
0answers
11 views

Applescript automating setting Security Config in Outlook365

I am attempting to automate setting up laptops. So far I've managed to script adding a new account with the correct parameters. Next is to select the SSL certificates that have been installed on the ...
0
votes
0answers
45 views

Applescript how to choose file for all files or list of extensions

I have a cross platform project and need to do it in GoLang, but I do not have Mac. Could you provide correct syntax to the following? 1.Choose file for all file type? choose file with multiple ...
0
votes
0answers
46 views

Getting Syntax Error “Can’t get every text item.” while creating new Service on Mac

I am getting the following syntax error while creating new Service on Mac while using below script, I have attached screenshot as well: "Can’t get every text item." on searchReplace(theText, ...
0
votes
0answers
18 views

macbook pro starts up when asleep and not connected to power

I occasionally open up the bag I use to carry my macbook pro (running Mohave) and find the fan is running and the computer is hot. This is usually after a red eye. When I try to log into the ...
0
votes
0answers
24 views

How to make AppleScript ignore escape characters in string to make a Note

I have a python script that takes a user's input and inserts it into the name and body parameter of the make new note apple script. The problem is that any escape or special characters get interpreted ...
0
votes
0answers
32 views

Distribute bash script 'silently' to multiple macos machines

We want to deploy a script 'silently' across all mac machines in organization. We have created a bash script that will run using launchd agent. We need to deploy the launchd agent and script on all ...
0
votes
0answers
17 views

how to open file type with app on remote machine via apple script app as default app for file type

I would like to set the default file association for a file type (PDF) to an Apple Script app. The Apple Script app will open the file type on a remote machine (using remote Apple events) with a ...
0
votes
0answers
19 views

How to receive URI requests in applescript

I want to open a link like testApp://test And for that to open the AppleScript that will receive the "test". Is this possible and if so, how would I go about doing it? So far, I made this in the ...
0
votes
0answers
60 views

It is possible to open links with AppleScript?

I want to create an AppleScript that will open once I click a link in a browser. For example, on Mac App Store links, you can click a button that will open the App Store on your computer. How would ...
0
votes
0answers
19 views

Unable to save applescripts-created email in drafts folder in Outlook version 16

So I've been using applescript with Outlook version 16 to automate some tasks. I want to create an email and then save it in the drafts folder but i've been unsuccessful. I've tried several ...
0
votes
0answers
31 views

AppleScript: Wait for Firefox Page to load

https://apple.stackexchange.com/a/320105/319746 I was trying to find a Firefox equivalent to the script in the link above under the line "Safari's Reload button", which monitors particular properties ...
0
votes
0answers
20 views

Smart Folder from arbitrary script output?

This is a long shot, but is it possible to create a Smart Folder which, instead of building its search using the Search Criteria UI, but instead use the properly formatted output of necessary for a ...
0
votes
0answers
26 views

Working with Apple HTML class data in AppleScript

I saw the following line of code in this post on AppleScript coding of HTML class data. do shell script "osascript -e 'try' -e 'get the clipboard as «class HTML»' -e 'end try' | awk '{sub(/«data ...
0
votes
0answers
77 views

Applescript (move file to folder) and highlight next file in finder

i made an applescript, fairly easy, to move a file to another folder in finder and use it with bettertouchtool as shortcut. tell application "Finder" move selection to folder ((path to home ...
0
votes
0answers
27 views

Rename JPG's Based on Portion of Parent and Subfolder and Number them Beginning with 100

I see similar questions have even addressed, but I don't see anything this specific. Is it possible to make a folder action that runs automatically and only on certain types of files (jpg)? And... ...
0
votes
0answers
14 views

Showing apps as overlays on any space using a hotkey

From my linux days, there were terminal emulators which allowed pressing a key, and then appearing as an overlay on any workspace. I was missing this feature on macOS, and was wondering is it possible....
0
votes
0answers
24 views

How to run an AppleScript from a Mail rule when screen is locked

I wrote an AppleScript to send an email with a hashtag in the subject to trigger@applet.ifttt.com and I created a Rule in Apple Mail to run the AppleScript when a new mail is from a specific sender ...
0
votes
0answers
57 views

Applescript temporarily stop user input/detect through mouse and keyboard

I've looking through apple forums and here looking for a solution. The only solution I could find was to permanently disable the built in Keyboard (which is clearly not a great solution). Can anyone ...