Tag Info

New answers tagged

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

1) Automator -> New -> Servivce. System Preference -> Keyboard -> Shortcuts -> Services 2) BetterTouchTool 3) Karabiner


0

Terminal: defaults write -g com.apple.scrollwheel.scaling -float 1.0 And log-out/log-in. 1.0 is just a guess. Maybe also try 1.5. This is a hidden preference so default value is not known. Fiddle around a bit to find the speed to like. If it doesn't work, or you wish to restore to back to how it used to be: defaults delete -g ...


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.


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


0

.scpt is in binary. .applescript is in text. You can use Spotlight/Finder's find function to search for words in .applescript. You cannot do this with .scpt. Since .scpt is already compiled, it's quicker to launch. My favorite thing about .applescript is that I can write that a script that read/write onto itself, so that variables are saved for next run ...


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

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.


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


0

To add one Desktop Space to each monitor/display: do shell script "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control" delay 0.5 tell application "System Events" to click (every button whose value of attribute "AXDescription" is "add desktop") of group 1 of process "Dock" delay 0.5 do shell script "/Applications/Mission\\ ...


0

First of all, the syntax of code may not be correct. This is how I would write it: if visible of application "Safari" is false then --Do Something end if Secondly, an app has to be already activated to have an value for boolean visible. What you might want instead is set frontmost to true.


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


0

I would say that considering Automator contains scripted actions which are based in Applescript there is indeed a way to script Preview, just depends what you're trying to do. Some perusing in the Automator actions section for Preview may yield good results. There are a number of tools I use such as rotation and scaling operations for batch processing ...


0

I'm parking this here as a placeholder so I don't forget what I wrote - still needs clarification from the OP To tidy up your existing script - you don't need to tell 'me' to activate, it already must be frontmost to work at all. tell application "System Events" keystroke "PASSWORD" keystroke return keystroke return end tell ...


0

How about this? It works on my 10.6 Macbook. It is cleaner than having to escape quotes etc... osascript returns a status like normal unix programs. Bash script aborts on a status 1 from osascript. No unnecessary messages from osascript - >dev/null 2>&1 I don't have anything else to test it on. You may need to adjust for other versions of ...


0

An alternative to grgarside's script, this doesn't need you to restart the Finder, just refresh open windows. Can be saved as an app or in Automator, as a Service. I have it as a Service, triggered on Cmd ⌘ H from System Prefs > Keyboard > Shortcuts > Services - which required me to change the 'Hide Finder' key command in …Shortcuts > App Shortcuts to ...


0

This sets the value of b to true or false depending on the current value of AppleShowAllFiles: [[ $(defaults read com.apple.finder AppleShowAllFiles) = 1 ]] && b=false || b=true Therefore, you can create a script such as this: do shell script "[[ $(defaults read com.apple.finder AppleShowAllFiles) = 1 ]] && b=false || b=true defaults ...


0

tell application "Finder" to open ((path to desktop) as text) & "FV.app"


0

Found this on another answer but an AppleScript that simply contains the following works for me. tell application "Finder" to sleep


0

Try this,,, tell application "Finder" if visible of process "Safari" is false then tell application "Safari" to activate end if end tell That will only work if it's running, but hidden, btw. If you simply want the script to 'fetch' Safari, just activate it without any check


0

Using Apple Script Editor located in your Utility folder you can do that with this command. Change the station URL to the one you want. tell application "iTunes" to open location "radio2.digitalgunfire.com:8000"


0

I think the code below speaks for itself. The do shell script command shouldn't be used inside another application tell block. Still I prefer a vanilla AppleScript solution as below which is fine to be used in any context in the script. tell (current date) to set {_day, _month, _year} to {day, it's month, year} set _day to text -2 thru -1 of ("00" & ...


0

An indirect solution I'm currently using is M-!, and type open . in the mini-buffer, which opens the directory in the system-default application, which is Path Finder on my computer.


0

This uses the built in unix commands to get the Author. Try it and let me know if it needs a tweak. tell application "iTunes" set sel to the selection if sel is {} then display dialog "Please select something" buttons {"Cancel"} repeat with i from 1 to count of sel set the_track to item i of sel set the_posix_path to POSIX ...


0

I tested this using Yosemite and it does work. I assume you are doing a BIOS boot for Windows. If you are doing an EFI boot, then this script will probably not work. BIOS booting is the traditional way that BootCamp installs Windows on Macs. I added an additional button to allow changing the default operating system to Windows. You are aware that you can ...


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


0

The following related questions suggest that there doesn't appear to be an easy way for you to do this. http://stackoverflow.com/questions/7217724/mac-os-x-how-to-monitor-a-window-change-event http://stackoverflow.com/questions/853833/how-can-my-app-detect-a-change-to-another-apps-window The best you can do is query the current active window in a loop ...


3

You could use this script taken from here. #!/usr/bin/env python import os import md5 import pprint import sys import subprocess from time import strftime from urllib import URLopener from urllib2 import urlopen from xml.dom.minidom import parseString # Defines source and destination of image rss_feed = 'http://feeds.feedburner.com/bingimages'; dst_dir = ...


3

Solved! I used the Bing Wallpaper.app found here that does exactly what I needed.


0

do shell script "bless -mount /Volumes/WINDOWS/ -legacy -setBoot -nextonly" with administrator privileges do shell script "shutdown -r now" with administrator privileges Replace WINOWS with the name of your bootcamp partition. Source: Lifehacker.com


0

I wrote a command line utility that wraps over screencapture and the Quartz windowing library. Grab it here: https://github.com/thismachinechills/pyscreencapture Use it like this: ./screencapture.py Skype -t Current Call -w all_windows above_window


2

The SetFile utility is provided with Xcode, which Apple distributes at no cost. Once you have installed Xcode, you can issue the command SetFile -a T /path/to/foo.bar



Top 50 recent answers are included