Tag Info

New answers tagged

0

Basically you need to start off with reading the XLS file with AppleScript (and then tell "Mail" for each address you find). As a starter you can consult How to read excel data in background using applescript Introduction to Scripting Microsoft Excel Using AppleScript with Excel for Mac and work your way up from there.


0

The simplest and quickest way to do this in other languages would just be to drop each of your columns from excel into a list (array) and then have the whole thing in a loop and it will create the email fill the information and then send the email then loop back to the beginning and start again with values from each of the arrays at [1] and so on from there ...


0

Here you go. It works just fine on Snow Leopard.


0

I'm not saying this is the best solution, but it seems to have solved my problem. Instead of using a simple delay, which is being ignored for reasons I do not understand, I've switched to getting the time and looping until a new time is reached (it still uses a delay, but it doesn't matter if it ignores the delay since the script doesn't continue until the ...


0

Automator itself does not ship with self referencing Automator actions. GUI Scripting Alternative approaches include using GUI Scripting to automate interactions with the Automator application. See Accessibility Preferences and GUI Scripting for an example of how to set this up on recent versions of Mac OS X. automator Command Line Tool OS X includes an ...


0

If I understand the question correctly all you need is to get the current directory of the application. Quick looking through SE answers pulls out this: set YourPathVariable to POSIX path of ((path to me as text) & "::")


0

You can in a round about way using the "Recently Played" playlist. You configure it the way you want, I've set it to the 5 most recent items, and then run this code... tell application "iTunes" set rp to get playlist "Recently Played" #get name of every track of rp #get name of last track of rp #set tid to get id of last track of rp ...


0

Ok found it. The shell script needed to have the following lines: osascript -e 'tell app "System Events" to restart' killall "Terminal" The shell commands above initiate the restart through an ad hoc Apple Script command, but kill the Terminal immediately after. This has the effect to quit the Apple Script app just before the OS X restart process does ...


1

You can try to redirect the shell command with do shell script "insert_your_command &>/dev/null &" and then tell you app to quit EDIT You can add a delay before redirecting the command as well. do shell script "(sleep 5 ; insert_your_command) &>/dev/null &"


0

My guess is OS X is restoring the Apple Script App state after it restarts. You could possibly try and have the Apple Script delete it's own application state right before the restart command, though I haven't verified that this works, or is possible. It should be located in, ~/Library/Saved Application State/.


1

Have your AppleScript write an empty file to a predefined location and test for its existance when the script starts. If the file is already there, delete it and quit the script; otherwise proceed as normal and reboot.


0

D'oh! Finally figured it out, and it's all my fault. Setting visible:true is the key. The problem was that I was always editing the original scripts in my ~/Library/Scripts/ folder, but testing them by using the hot key I set up to trigger...duh...the Automated workflow files in ~/Library/Services, which I had not updated. Posting an answer in case someone ...


3

Solution 1: sed Option -r of GNU sed is -E on the OS X/BSD sed (the one that comes with the OS, /usr/bin/sed). And to get rid of the encoding problem with 's, add export LC_ALL=en_US.UTF-8; export LANG=en_US.UTF-8; to the beginning of the do shell script command (see the question here): set original_text to "string  string  string  $  text1 string  ...


1

[edit after more research] You can use Applescript to turn on and off the dock's autohide. You can't use Applescript to determine whether you have open/visible windows. This is because Applescript treats each application as an object, and some applications handle windows differently, meaning they can't all be manipulated or detected. I haven't even been ...


1

You don't say what problem you're running into, so let me guess. If you're having trouble with how to phrase the "-- show a message and exit with non zero status" part, use the error command: #!/usr/bin/env osascript tell application "System Events" set apps to the name of every process whose background only is false end tell if "Some Application" is ...


0

If your osascript (above) works you can launch it via a shell script. Turn the osascript into an app with the script editor. Then this shell script could be your git pre-commit hook. Something like: #!/bin/bash /usr/bin/osascript $HOME/bin/YOUR_OSASCRIPT.app 2>/dev/null I use this technique to launch scripts via crontab so it should work in your ...


0

This problem is caused by Apple's sandboxing of Preview (and other apps). Preview does not receive an entitlement to access the PDF if you just pass it a string to open. From Apple's release notes: Compatibility Notes When sending commands to a sandboxed application, such as TextEdit in OS X Mountain Lion, parameters that refer to files must be of ...


2

After some searching, I found SleepWatcher, a free tool that allows to run a script when the screen goes to sleep or wakes up. After installing it, you can link a shell script that is run on one of the available events (which include dim screen, wake up screen, computer sleep, wake up computer and some more). From the shell script, I can run a command, or ...


1

iBooks doesn't have AppleScript support. The annotations are stored in a SQLite file: ~/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation/. You could try to parse that. This answer gives a link to Digested, which reads that database and then allows you to export your annotations to Evernote, but I don't know what formatting they'll have or ...


1

EventScript has a few options that might work for you. It's a neat little utility that can trigger .sh/applescript/automator workflows and trigger them on a host of different options. Here's some screen locking/unlocking options: Check it out here: http://mousedown.net/mouseware/EventScripts.html


1

You can force codesign after You change bundle content. In Terminal.app use something like this: codesign -f -s [identity] /path/to/bundle For more info please read man codesign.


0

You can use direct path to the application inside Your Apple Script. This will looke like: set p to "/Applications/Safari.app" tell application p to activate Here's the link about AppleScript and POSIX paths


0

When you type tell application "whatever" and you click compile, if whatever does not exists, it will appear a window that let you choose the application. Try this way.


0

I'm sure there is a better way, but, from now, this is the only way that works for me: tell application "iTerm" activate set the clipboard to q delay 0.5 tell application "System Events" to tell (name of application processes whose frontmost is true) to keystroke "v" using command down tell application "System Events" to tell (name of ...


0

GUI scripting is not that great. And can easily fail due to timing or GUI changes. But try this: set mboxSavePath to "/Users/simonepiersigilli/Desktop/e-mail/" tell application "Mail" to activate tell application "System Events" tell application process "Mail" click menu item 20 of menu 6 of menu bar 1 delay 2 keystroke "G" ...


0

set albumSongs to (every track of playlist (name of myPlaylist) whose album is currentAlbum)


0

Try: set playlistName to "playlist name" tell application "iTunes" set playlistReference to first playlist whose name = playlistName set currentAlbum to album of current track set albumSongs to (every track of playlistReference whose album is currentAlbum) end tell


0

This is a working example that I derived from the example in https://code.google.com/p/iterm2/wiki/AppleScript Check out the comment from stefan.v...@gmail.com tell application "iTerm" activate try set _session to current session of current terminal on error set _term to (make new terminal) tell _term launch ...


0

How about the following? It can be used as an app launcher. It doesn't stop the user of launching the app but for a child it should do. You could also easily convert it to a background script to continuously monitor for desired app and kill it once usage goes beyond allowed time block. Hope it helped. # The times to check. Use HH:MM:SS 24HR format or AM/PM ...


1

Below is a screenshot showing the raw clipboard data when copying three lines from Script Editor.app on OS X 10.10.1: The lines in Script Editor appear as: The outcome depends on your destination text editor when pasting. The copied lines are encoded in multiple formats on the clipboard. The destination of the paste determines which format is ...


1

Using Karabiner, you can save this file as ~/Library/Application Support/Karabiner/private.xml: <?xml version="1.0"?> <root> <item> <name>fn+escape to toggle f-keys</name> <identifier>fnesc</identifier> <autogen>__KeyToKey__ KeyCode::ESCAPE, ModifierFlag::FN | ModifierFlag::NONE, ...


1

set myPath to POSIX path of (path to resource "audio.m4a") do shell script "afplay " & quoted form of myPath or set myPath to POSIX path of (path to resource "audio.m4a" in directory "Stuff") do shell script "afplay " & quoted form of myPath You should look at the libraries in the library window of Script Editor. In this case ...


1

Try: set pathA to POSIX path of (path to desktop as text) & "test.app/Contents/Resources/Stuff/audio.m4a" -- or set pathB to POSIX path of (path to home folder as text) & "Desktop/test.app/Contents/Resources/Stuff/audio.m4a" do shell script "afplay " & quoted form of pathA


2

In order to assign a keyboard shortcut to this script, you could create a service in Automator. You must change Service receivesto no input. Then add Execute AppleScript and paste your script. Save it on ~/Library/Services. Once saved, you must go to System Preferences → Keyboard → Shortcuts and you can find out under Services → General. Assign your ...


1

I've been doing something similar recently and this is the most elegant solution I came up with: set scr to "on run argList return {|" & dictKey & "|: (item 1 of argList)} end run" set newDict to (run script scr with parameters {dictVal}) Hope it still helps!


0

The values you set before are not given via the inputparameter. As long as you run your Automator Workflow as an Automator Workflow and not as an Application or Service, you can access your formerly set variables using the following: tell application "Automator" set cat to value of variable "NameOfFirstVariable" of front workflow set x to value of ...



Top 50 recent answers are included