Tag Info

Hot answers tagged

4

You don't have to change System language to launch an app in different one. You can do for example this: /Applications/Maps.app/Contents/MacOS/Maps -AppleLanguages '(de)' This will launch Maps.app with german language set. Here are the other options: Is it possible to launch a program in a specific language?


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  ...


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 ...


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

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 ...


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

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!


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

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

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


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

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

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.


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

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.


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 &"



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