AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

0
votes
1answer
23 views

Cannot execute ssh-ed osascript properly inside of shell script

I have created a ip-down script in my etc/ppp/ directory. Essentially I am trying to kill certain programs/servers when the VPN disconnects, then display a notification on another computer via ssh. I ...
0
votes
0answers
12 views

How to script detection of an OS X program bouncing in the dock?

How can I use AppleScript or something similar to detect the presence of an app which is bouncing in the dock (in this case Adobe Illustrator)? Once I detect that Adobe Illustrator is requesting ...
1
vote
3answers
602 views

Is it possible to grab and store the returned window id of a terminal opened through applescript or bash?

I have been working on this "dashboard" to help control my localhost server environment. It has been scripted in bin/bash for reference. I recently discovered I can use the bin command "osascript" to ...
-1
votes
0answers
10 views

How to crawl through a dynamic jsp website?

Given a set of URLs like http://www.example.com/foo.jsp?id=1 http://www.example.com/foo.jsp?id=2 ... http://www.example.com/foo.jsp?id=2000 How can I crawl through them all and grab the text? And, ...
0
votes
0answers
10 views

How to get input with a custom dictation command

I'm trying to write a few scripts to allow me to write code via voice. However, I need a way to specify a way to capitalize a variable name. For example, I want to be able to say, "stud my super ...
0
votes
0answers
10 views

Mount AFP from terminal / AppleScript

I try to mount an AFP / SMB drive either from terminal or AppleScript, Used to have a code for that but can't find it, the only issue is my password have "@" character with probably make the terminal ...
0
votes
0answers
11 views

Mailing by aid of AppleScript with no user interface dialogues

I want to send a couple of emails with an AppleScript. The annoying thing about this script is that I have to do the last part of it, clicking the arrow icon. How can I avoid this? Sorry I am a newbie ...
8
votes
3answers
4k views

Programmatically set the color of a tab in iTerm2?

My daily workflow includes me Launching iTerm2 Creating 3 tabs Setting one tab each to red, orange and yellow Changing to a specific path in each tab I would like to script this process; shell, ...
0
votes
0answers
7 views

Save BBEdit file or folder as a project in AppleScript

I've looked through the dictionary of BBedit.sdef and I've searched several sites but I am not able to find if you can save a folder as a project with AppleScript. I am familiar with saving a ...
0
votes
0answers
31 views

Keyboard shortcut to “Love” currently playing song in iTunes 12 on OSX

It seems as if apple has forgotten to build in a keyboard shortcut for "Loving" or "Hearting" the currently playing song in iTunes. This is unfortunate because often whilst I am working I would like ...
1
vote
1answer
28 views

Export iTunes library?

A long time ago, I remember using an AppleScript I downloaded from somewhere that exports all the music files from my iTunes library into folder neatly organised by artist and albums. Now, I am ...
4
votes
4answers
5k views

Switch between Google Chrome Tabs using AppleScript

I was hoping that the following code would do the job, but no cigar: --Only the window is brought into focus tell application "Google Chrome" activate tab 1 of window 1 end tell
0
votes
1answer
51 views

Automatic open new browser tab on Mac OS X

Im trying to create a action in Automator, but I am not sure if its possible only use this software or I would need use applescript. I need to create a action for when I set a specific URL in some ...
0
votes
1answer
56 views

Is there a way to have two or more clipboards via keyboard shortcuts for storing & using multiple text items simultaneously? (OSX)

I would like to be able to have multiple clipboards on Mac OSX (happen to be using Mavericks currently). The end-solution would look something like this: Let's say I copied one piece of text using... ...
1
vote
1answer
17 views

How to send a signal to a running Applescript

I am running a script that basically has a loop inside a loop. I need some way to signal this script to break out of the inner loop. repeat doxyz repeat doSoreWork if signalPresent ...
2
votes
1answer
82 views

Are Snow Leopard text substitutions scriptable?

I prefer using typographical quotation marks when possible, so I love the Smart Quotes part of Snow Leopard’s text replacement feature. But there are a few cases in which I need to toggle it, and it’s ...
1
vote
1answer
471 views

How to create a schedule for SelfControl app

I want to block my blacklist Mon-Fri 6am-12pm and 1pm-5pm (closely related to this post), but I don't know enough about Applescript to know how to set up a schedule. Any ideas for how to achieve ...
3
votes
2answers
5k views

How do I run an Automator action, shell script or AppleScript on startup in OS X?

I know you can run applications on startup on a Mac, but can you run an Automator action, a Service, a shell script, or an AppleScript on startup instead? I also know you can save all of these as an ...
0
votes
1answer
107 views

Sharing variables between applescript and bash script in same script

Is it possible, in a bash script, to have a variable, but also allow applescript (with osascript) to use that variable?
8
votes
8answers
6k views

MacOS X: How to have a handy “Open this folder in iTerm” shortcut?

I think the title states exactly what I want to do. I want a shortcut or even a button within Finder which fires up a new iTerm Tab and changes the location to the location i've open in Finder. Some ...
0
votes
0answers
25 views

applescripted keybinding issue with extended keyboard's number keys

I've written an applescript that remaps the Switch to Desktop n commands to the extended keyboard's numbers instead of the main keyboard. I've looked up the codes and they are Key codes 82 - 92. The ...
0
votes
1answer
55 views

How do i write an applescript application from terminal?

I want to write an applescript application from terminal. So far I have been able to write an .scpt file but that is not enough. I need to convert it to an applescript application that can then be ...
0
votes
1answer
45 views

Creating a cycle between spaces on OS X

On Windows, I constantly used the keyboard shortcut 'alt-escape', which enabled me to move from one window to another without having to press x times 'alt-tab'. I'm new to mac OSX, and it seems that a ...
0
votes
1answer
113 views

AppleScript to mount and unmount drives

this is my first post on this site, so excuse me if this is a double post but I couldn't find anything similar. I'm on Macbook Pro 13 early 2011, I have installed an ssd and moved the hdd to the ...
0
votes
0answers
30 views

AppleScript and Pages: change font of numeric characters

I have a Pages document written in a non-standard font. It's actually the New Testament in a Greek font, with verse numbers throughout. While the numbers show up properly, the font lacks the ability ...
1
vote
1answer
25 views

writeToFile in a .app

I am currently trying to write content inside an Applescript.app which is a resource file. I can write to the .scpt file if I copy it in a different folder out of the Applescript.app ...
1
vote
1answer
24 views

How do I close a window from an application but not quit the application

I'm trying to have a shell script run and then close itself but not quit Terminal all together. Here's what I have: #!/bin/sh while [ "$JOB_NUMBER" = '' ]; do echo -n "++++++++++++++++++++Job ...
0
votes
1answer
40 views

Shell script, AppleScript Mac OS X

I’m trying to copy embedded metadata from image files and write to a .txt file, as well as generate MD5 and SHA1 checksums for the same images to be added to the same .txt file. I can run this ...
1
vote
1answer
130 views

automatic new mac setup (dotfiles, scripts, etc)

I'm looking for a way to automate the setup of a new macbook I'm about to purchase. I've done through quite a few during the years and it always takes forever to get everything up properly. I don't ...
2
votes
3answers
10k views

Open new terminal tab and execute script

I need to merge two osascript scripts, so that with one command I can open a new terminal tab and execute a script like echo hello into that new tab. This one opens a new terminal tab. osascript -e ...
0
votes
0answers
28 views

Applescript - how to tell which window is topmost on second screen?

I need to find topmost window on a given screen. I thought I could calculate the screen using position or bounds so this is not a problem, however I am struggling with the index property. I tried ...
1
vote
0answers
10 views

Applescript to create hyperlink at cursor location on MS Word

I want an applescript to create a hyperlink at the blinking cursor. I can't change the range so that it matches the cursor. Any help on this? Thanks! tell application "Microsoft Word" tell ...
0
votes
0answers
28 views

Send click event to dialog shown through display dialog command in OS X Terminal

I have an sh script that displays a dialog; this dialog can be closed by the user but I am looking at a gracious way to close it, from within another similar script, run at a particular moment, if ...
0
votes
0answers
33 views

Applescript to create link in specific place of MS Word document

I'm trying to make an applescript to work like this: 1) I let the flashing cursor at the precise place where I want the link to appear in the MS Word (v. 15) document. 2) I press a keyboard command ...
0
votes
2answers
41 views

Click Every Word that ends with “.log.gz” in Any Language Compatible with Google Chrome

I have looked up the answer to this already and cannot do this with the programming languages I know, so I'd like the code for this and an explanation as to how it works so I can use this in future ...
5
votes
5answers
3k views

How do you duplicate current open Finder view in new tab (Mavericks)?

In a thread on this forum there is an interesting solution on how to open a duplicate of an already open Finder window with the help of an AppleScript: How do you duplicate current open Finder view? ...
1
vote
1answer
91 views

Write content to file with Automator

I'm building an Automator Service to create an .html file and write some text in it. I've managed to create my .html file by using the New Text File action, but how can I write text in it? I see no ...
4
votes
4answers
4k views

Quotes within quotes applescript

I am doing an applescript that is supposed to set an command with quotes an varible. This is the code so far: set myString to "This is a "quoted" text." But an error occurs because applescript ...
1
vote
2answers
36 views

How do I to modify Automator Service ditto command?

Using and Automator Service and an AppleScript that is redly available and exists on this thread of but a "GUI" around ditto. The solution works well, however, I am not getting the behavior I ...
0
votes
1answer
97 views

How to prevent AppleScript error while website is still loading?

This is a service that copies a text and execute an applescript to simplify my life. The applescript searches a website on Safari and then clicks on specific links in two pages. The problem is that ...
1
vote
0answers
75 views

Toggling Yosemite's Notification Center between “Today” and “Notifications” views (back and forth)

I want to create a keyboard shortcut/trackpad gesture to: - display Yosemite's Notification Center first - then toggle back and forth "Today" and "Notifications" panes every time the corresponding ...
0
votes
1answer
157 views

script needed to Reset group permission to enclosed items in folder OS X Yosemite

Error with Excel document falling read only on server shared document. i'm looking for a script to apply "group" folder permission to all included files.Every day at a specific time 8pm.to fix ...
1
vote
2answers
175 views

Open “About This Mac” from Terminal?

This probably seems totally useless to most, but i've got a specific need to open the "About This Mac" dialog from within Terminal. Any idea if its possible? I suppose AppleScript might be the way to ...
0
votes
1answer
58 views

How do I create a new database?

Since upgrading to Yosemite 10.10.1, I can't create a new database set theOutputFolder to choose folder with prompt "Please select an output folder:" tell application "Database Events" make new ...
1
vote
1answer
73 views

How to periodically show alert message *in foreground* on Mac OS X?

I want to have an alert / dialog box to fire up periodically in foreground on my Mac. I tried a combination of AppleScript and launchd and managed to have the script (actually converted to a app) ...
0
votes
1answer
42 views

How can I stop Drobox sync during the day and automatically start at night

I'm trying to stop the Dropbox daemon from running during the day. I'd like to start it and perform a sync around 6 pm daily. I'm running Mac OS X Yosemite 10.10 on an iMac 27'.
0
votes
1answer
47 views

Applescript Ext Loop early

I've created an applescript loop that automates a repetitive task. It prompts for the amount of times to loop, and then does it's thing. However I've been asked for a way to exit the loop, if for ...
0
votes
0answers
110 views

How to launch an AppleScript via URL handler?

Here's my workflow, I want to create clickable links in various places that run scripts with inputs. For example, I might have a link ...
1
vote
1answer
226 views

Extract text from HTML using Applescript

I am looking to extract text from an html using Applescript, here is the code: <div class="vk_bk vk_ans">3:27 PM</div> I want to extract "3:27 PM" which is the result google gives you ...
0
votes
0answers
15 views

Applescript Google Search results [duplicate]

Does anybody have an idea on how i could start a script that extracts google's quick answers to applescript. Like when you google the time in a certain place google will give you a direct answer in a ...