AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

0
votes
0answers
6 views

Applescript to get link from a button on a Safari web page and copy it to the clipboard

I'm struggling to make an Applescript that gets the URL of a specific button on Safari and then copies it to the clipboard. This is the source code: <div ...
0
votes
1answer
17 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
0answers
12 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 ...
4
votes
1answer
49 views

Remove All Illegal Characters from All Filenames in a Given Folder and subfolders

I Know this was was basically answered and the automator with the shell script (Sanitize Filenames) works great, but I need it to also do all subfolders as well. And if possible trim the file name ...
0
votes
0answers
75 views

Applescript/Automation in Outlook 2016 for Mac

Im trying to script some automation for some repetitive tasks I do in my workflow. My script (as of now) needs to accomplish only a basic task, but nonetheless, timesaving. I need it to (when called ...
0
votes
0answers
17 views

open ssh server file automatically with apple script

Hello respected persons , i am trying to build a apple script which first open terminal login in ssh with details and after login it open a python script which is on ssh server automatically . i ...
0
votes
1answer
43 views

How do you add a spotlight comment to a folder

How do I set a spotlight comment for a folder using Bash. (Or Applescript) The following example is not working: osascript -e "tell application \"Finder\" to set comments of alias POSIX file ...
0
votes
0answers
30 views

Applescript to upload files to OneDrive

I am wondering if anybody knows how to Upload a file to OneDrive using an applescript. I would connect this applescript to Automator so if the script could include the necessary variable parsings for ...
0
votes
1answer
43 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
17 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
0answers
32 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
27 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
12 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 ...
0
votes
0answers
13 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 ...
1
vote
0answers
91 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
51 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 ...
1
vote
1answer
21 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 ...
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
56 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
54 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
66 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
187 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
41 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
27 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
182 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 ...
0
votes
0answers
32 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 ...
0
votes
1answer
43 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
2answers
45 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 ...
0
votes
1answer
48 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
149 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 ...
0
votes
1answer
146 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?
1
vote
0answers
81 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
188 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
214 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 ...
1
vote
1answer
27 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 ...
1
vote
2answers
44 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
65 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
88 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
45 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
52 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 ...
1
vote
1answer
275 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
1answer
171 views

Applescript can't get process “…”

I am getting an error in applescript In the first script i created a search engine and the script is as follows on dialogBox(theMessage) display dialog theMessage default answer "" buttons ...
1
vote
0answers
76 views

NSUserAppleScriptTask and Script Monitor

I am wondering why some users of our app ghostnoteapp.com see the Script Monitor icon in their menu bar and others, including myself do not. According to the AppleScript release notes " (Script ...
0
votes
1answer
149 views

Applescript exec shell script with space in path

The problem I'm trying to solve is to simply run Google Chrome with the --disable-web-security switch in OSX. Since it appears that I cannot add a switch (argument) to an alias I started looking for ...
0
votes
1answer
61 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 ...
0
votes
1answer
705 views

Make Applescript wait for an application to be closed before running a shell script

I have an applet i made using Applescript which opens an Application and then once it's loaded runs a shell script which unload's Spotlight. I need to make it then wait for me to finish using relevant ...
0
votes
0answers
86 views

Applescript command to make window unclosable

I have an applescript program that auto opens whenever I wake my computer. I would like it to be unclosable until I input a password into it. Tried searching but found absolutely no sources that ...
0
votes
0answers
28 views

Why would this tell command start a program?

The following applescript is run as part of a larger program that I regularly use: on run {viewer, path_to_pdf} if viewer is "Skim" then display notification "Skim opened: " & viewer ...
0
votes
1answer
177 views

iMac G4: auto playing iTunes music using Automator

I have used Automator and I have successfully set up events using it and iCal before. I would like to play a playlist from my iTunes using Automator, the problem is that there is no "Play Playlist / ...
1
vote
3answers
496 views

How do I automatically print only part of a PDF page in OS X?

I frequently have to crop out the top half of a PDF (it's a shipping label) and only print that on A4 paper, instead of the whole label. I can do this very easily with Adobe Acrobat Pro, by opening ...