Questions tagged [applescript]

AppleScript is an end user scripting language that has been available in Mac computers since System 7 Pro (7.1.1). It allows for automation of system tasks, communication between processes, and creation of workflows, amongst other functions.

AppleScript is a inter-application scripting language, designed to control and exchange data between scriptable applications. Users can use AppleScript to combine the functionality of multiple scriptable Mac applications to form a new application to meet their special need or demand without "reinventing the wheel".

Resources

8740 questions
2
votes
1 answer

Make the "display dialog" window the front window in applescript

I want to display a dialog. This works, but it is never the front window. I want it to be more like an alert sign. So when I want to type text in the dialog box, I always have to click on it first. Is there any way to display the dialog as the…
Collin Alpert
  • 475
  • 6
  • 14
2
votes
3 answers

Applescript Display Dialog User Input

I'm running an applescript program where I am asking for the user to type in their name. If the user clicks "OK", then the name gets stored to the variable I want. However, if the user clicks "Cancel", then the program just quits. How do I set…
John
  • 21
  • 1
  • 2
2
votes
1 answer

Can't get POSIX Path of given application in Applescript

I've written some Applescript to create a list of paths of all applications running in the dock: set appsRunning to [] tell application "System Events" repeat with p in every application process if background only of p is false then …
2
votes
1 answer

AppleScript - how do I select a menu item in a pop up button that has no title?

Relatively new to AppleScript here... I'm trying to create an AppleScript to automate a File/Save Page As... action in Firefox. Specifically, I need to select "Web Page, complete" from the Save As... dialog instead of the default "All Files"…
Mac471
  • 423
  • 5
  • 16
2
votes
1 answer

Restart Dock from app

I have an app that needs to restart the dock application. I have tried this with both Apple Script: var errorDict: NSDictionary? = nil let appleScript = NSAppleScript(source: "tell application \"Dock\" to quit") var error =…
Paul Peelen
  • 10,073
  • 15
  • 85
  • 168
2
votes
4 answers

How to reveal default Safari downloads folder through Applescript?

I am new to AppleScript and would like to know how to reveal the default downloads folder in Safari through AppleScript. --- WHAT I HAVE ALREADY TRIED --- set filePath to do shell script "defaults read com.apple.Safari DownloadsPath" do shell script…
Talal Rafi
  • 23
  • 3
2
votes
0 answers

AppleScript for Outlook 2011 for Mac to save all attachments to external drive and then remove them from emails

I have an Outlook 2011 (Mac) version of this question: save all email attachments in outlook folder to folder And, I've seen AppleScripts at places like this:…
bacchus6
  • 21
  • 3
2
votes
2 answers

How to tell Finder to select/reveal multiple files in AppleScript

Using the following code: tell application "Finder" to reveal every item of theFiles Works when theFiles contains a single file, but when it contains multiple files, I get: error "Finder got an error: AppleEvent handler failed." number -10000 What…
Jeremy Cantrell
  • 26,392
  • 13
  • 55
  • 78
2
votes
1 answer

POSIX path in AppleScript

I am trying to run a bash script as sudo from AppleScript and I want to fill in the user name and password, I have googled out this solution: on run {input, parameters} do shell script ("sudo /Applications/XAMPP/xamppfiles/run_mysql_sudo '" &…
Martin
  • 91
  • 3
2
votes
1 answer

Adding AppleScript to Bash Script

I have the following Bash Script. !#/bin/bash fscanx --pdf /scandata/Trust_Report if [ "$?" = "0" ]; then I would like to run the following AppleScript tell application "FileMaker Pro Advanced" activate show window "Trust Reports" do…
JFWX5
  • 21
  • 2
2
votes
4 answers

AppleScript Tell Application Microsoft Excel Opens Windows Excel on Mac with Parallels?

I am trying to use AppleScript to manipulate Mac Excel 2011 files on a Macbook Air running OSX Mavericks. I also have Parallels installed with Windows 8.1 and Windows Excel 2013. When I run the following test script, it starts up Parallels, Windows…
Mac471
  • 423
  • 5
  • 16
2
votes
1 answer

NSAppleScript Wont Work

Can someone please tell me why this won't work? NSAppleScript* playPause = [[NSAppleScript alloc] initWithSource: @"\ tell application \"System Events\"\n\ tell application \"Final Cut Pro\" to activate\n\ keystroke \" \"\ end…
winduptoy
  • 5,366
  • 11
  • 49
  • 67
2
votes
1 answer

Applescript Error -1700, cant make ~/Desktop/ into an alias

set source to (choose folder default location ("~/Desktop/") with multiple selections allowed) repeat with filetocopy in source set n to (quoted form of (POSIX path of filetocopy)) & " " set dir to do shell script "dirname " & n set bn…
Recon
  • 608
  • 9
  • 18
2
votes
1 answer

how do you find the square root of a number in applescript

I have a simple calculator code and I want to include square root in it. I am relatively new to applescript and I have no idea how. It might be nooby but thanks anyway!
samrockw22
  • 59
  • 6
2
votes
1 answer

where can I get a good SDEF editor?

I'm writing an objective C program which will need to be applescriptable. so, I need to create and edit an SDF file. I'd MUCH rather not have to write XML if I don't have to, so I'm hoping that someone can point me to a good editor... I've found…
Brian Postow
  • 11,709
  • 17
  • 81
  • 125
1 2 3
99
100