Tag Info

Hot answers tagged

9

William R. Cook's paper contains an excellent history and insight from those involved with AppleScript in 1989. What follows is fun and speculative. Conservation of Space and Processing AppleScript was written at a time when every byte and bit was valuable. OS X's lazy encoding as property list formats would be wasteful in the eyes' of those early ...


5

In short, .scpt allows backward compatibility. Plus, applescript/javascript (etc) can saved with the same extension, given that Script Editor now supports javascript. To decompile .scpt in shell: https://github.com/rupa/applescript/blob/master/decompile.sh The most relevant part: osadecompile Textmate is a third-party editor that can read .scpt: ...


3

Based on this from an old Applescript Release Notes on sandboxing… When sending commands to a sandboxed application, such as TextEdit in OS X Mountain Lion, parameters that refer to files must be of an explicit file-like type and not a bare string, or the target application will not be able to access the file. For example, file "Macintosh ...


2

Your headache lays with how Steam handles its exit status. Steam probably doesn't have applescript integration, so it considers a quit command from applescript an unclean exit. It would still quit, but it will let you know about it. What you need is a way to ignore the error message and execute the rest of the script nevertheless. try tell application ...


2

A pure guess would be that you are passing it a text/string reference rather than a file ref. try set audioFile to POSIX file "/Path/to/the/audio.mp3"


1

beroe, I love your answer. Let me add a little detail… tell application "Google Chrome" activate end tell could be change to: tell application "Google Chrome" to activate Make you skip two lines… ;-)


1

You must use the text from the first document instead of putting it into a list. Put the searching text and replacing text from the second document into a list. Like this script : tell application "Finder" set filePath to (first file of folder "Data1" of desktop) as alias set filePath2 to (first file of folder "Data2" of desktop) as alias end tell ...


1

Basically you want to find a bunch of files which are empty (have size 0 bytes) and then change their content to "This file is empty". cd to/wherever/the/files/are find . -type f -size 0 -print | while IFS= read -r line; do echo "This file is empty" > "$line" done If instead you want to remove them, run cd to/wherever/the/files/are find . -type f ...


1

I found an answer to this via google. This Applescript will send the iMessage: tell application "Messages" send "Text of Message" to buddy "+61mobilenumber" of service "E:*icloud email address*" end tell I saved that as an app, then set a recurring iCal event that will open the app at the time I set every day. Voila! Beautiful.


1

I've managed to solve it quite o.k. tell application "Contacts" tell application "System Events" set theName to full name of current user end tell set theNick to nickname of person theName if theNick is not missing value then return theNick else return word 1 of theName end if end tell It would be better to ...


1

With Launchbar you can run scripts in the background by pressing Option+Return, rather than just Return. This works for me, whereas Return by itself did not.


1

First, (Automator -> New -> Service) to paste the code, and then (System Preferences -> Keyboard -> Shortcuts -> Services) to bind the Service to a keyboard shortcut. BetterTouchTool Karabiner


1

Some (perhaps all) services are context specific. They will only be offered/enabled when they can be used. For example, a service that is meant to act on a piece of text will only offer itself when text is selected. You can try this yourself in Safari. Select a piece of text in Safari and check the Services menu, you should see numerous options including ...


1

This worked set appName to "username" set appPass to "password" tell application "System Events" repeat while exists (processes where name is "SecurityAgent") tell process "SecurityAgent" if exists (text field 1 of window 1) then set value of text field 1 of window 1 to appName set value of text field ...


1

You can use perl to convert escaped unicode character from ASCII text : tell application "iTunes" set sel to the selection if sel is {} then display dialog "Please select something" buttons {"Cancel"} set tc to count sel repeat with i from 1 to tc tell (get item i of sel) set loc to location set authorfield to ...



Only top voted, non community-wiki answers of a minimum length are eligible