Tag Info

New answers tagged

0

Did you consider using Keyboard Maestro? Here you can see how I deal with this. I use it to change between screens, but is really easy to modify per your requests.


1

Simple toggle on or off that does not need to check state first. property thePane : "com.apple.preferences.bluetooth" tell application "System Preferences" activate set the current pane to pane id thePane --delay 1 end tell --- tell application "System Events" tell application process "System Preferences" try ...


1

Updated/Better Answer: 1) This new script doesn't flash. 2) For reasons unbeknownst to man and logic (or just me), applescript sometimes/almost-always fails to Turn Bluetooth Off, if the System Preference window is in the background. Instead of turning off, what actually occurs is that Bluetooth immediately re-enable itself, so the pane is in a fresh ...


1

Use the select command to select the row. tell application "System Events" tell process "iTunes" set frontmost to true delay 1 tell pop up button 2 of window 1 click tell (select row 5 of table 1 of pop over 1) to click UI element 1 end tell end tell end tell


0

You can implement a mail merge using AppleScript. Gianugo Rabellino shared his initial AppleScript for creating such messages in Poor man’s mail merge in Apple Mail. The comments on Rabellino's post suggest improvements and other approaches. Bryan Klein's Applescript for Simple “Apple Mail” Merge Feature builds on the AppleScript and provides a copy to ...


1

This runs say a if the time since the last HID (pointing device or keyboard) event is over 3 seconds and if the frontmost application is iTerm: while sleep 10;do [[ $(ioreg -c IOHIDSystem|awk '/HIDIdleTime/{print $NF/1000000000;exit}'|awk '$0>3') && $(lsappinfo visibleProcessList|cut -d\" -f2) = iTerm ]]&&say a;done Different ways to ...


0

You can use VLC (free, open source, cross-platform): it has a feature to stream music/video across your local network, thereby allowing to be used to stream audio to multiple computers at the same time. Guide: Download VLC media player Install VLC on each computer you plan on streaming to or from. Open VLC on the main computer (the computer ...


0

Consider using Sikuli to implement your task rather than AppleScript: Sikuli automates anything you see on the screen. It uses image recognition to identify and control GUI components. It is useful when there is no easy access to a GUI's internal or source code.


1

tell application "System Events" to picture of desktop 1 View all properties: tell application "System Events" to get properties of every desktop


0

Use a run handler: on run {input, parameters} input end run Or if you need the input as a list of POSIX paths: on run {input, parameters} set l to {} repeat with f in input set end of l to POSIX path of f end repeat end run For a script saved directly in /Library/Scripts/Folder Action Scripts/, use an adding folder items ...


1

This fixes the first quirk but not the second one: tell application "System Events" bundle identifier of process 1 whose id is 1234 end tell tell application id result reopen activate end tell The same applies to open: open -a "$(ps -p 1234 -o comm=)" If there are no open windows, reopen opens a new default window, and if all windows are ...


0

You could use the Guest account and Parental Controls. Otherwise create a separate account for each user if thats manageable and setup custom parental controls that block what you want for the separate users. Set up parental controls


1

tell application "Finder" to delete ((POSIX file "/Users/user1/Library/Application Support/Skype/tankitan") as alias)


1

tell application "System Preferences" activate set current pane to pane "com.apple.preference.energysaver" end tell tell application "System Events" to set bool to value of attribute "AXValue" of checkbox 1 of window 1 of process "System Preferences" tell application "System Preferences" quit end tell if bool is 1 then display notification ...


1

Update: This updated script wouldn't flash through the screen, i.e runs in the backgound. The old version is still valid. tell application "System Events" tell process "System Preferences" activate end tell tell application "System Preferences" set current pane to pane "com.apple.preference.energysaver" end tell tell ...


1

The question is vague. Do you mean an applescript to display the dropdowm menu from the battery icon on the right hand side of menu bar? tell application "System Events" to tell process "SystemUIServer" click (first menu bar item whose value of attribute "AXDescription" contains "Battery") of menu bar 1 end tell


1

Edit the root's crontab (by for example running EDITOR=nano sudo crontab -e) and add a line */15 * * * * ifconfig en1 down;ifconfig en1 up where en1 is the identifier shown by networksetup -listallhardwareports|awk '/^Hardware Port: (Wi-Fi|Airport)/{getline;print $2}'. The ifconfig commands require superuser privileges.


0

tell application "System Events" to tell process "SystemUIServer" click (first menu bar item whose value of attribute "AXDescription" contains "Wi-Fi") of menu bar 1 try click menu item 2 of menu of (first menu bar item whose value of attribute "AXDescription" contains "Wi-Fi") of menu bar 1 end try end tell


1

Try: tell application "Mail" to set previousRecipients to address of every recipient of messages of mailbox "Sent Messages" of account "my account name"


0

Here's a cool one that I use in a ruby script on OS X (so that I can start a script and get an update even after toggling away from the window): cmd = %Q|osascript -e 'display notification "Server was reset" with title "Posted Update"'| system ( cmd )


2

DISCLAMER: I can't check this (that it actually works) at the moment, but I will later. This script to turn on/off wifi is taken from here: try set makiaeawirelessstatus to do shell script "networksetup -getairportpower en1" on error display dialog "The script did not work as intended, please check the networksetup command (in terminal) works on ...


1

You can use simple command inside Terminal.app to rename all files in directory including subdirectories. Navigate to directory in which You have files to rename (cd /path/to/dir) and run this command: find . -name "*\.txt" -exec bash -c 'mv "{}" "{}.noindex"' \; This will rename all txt files. Change extension to whatever You want.


0

The following AppleScript will append the extension .noindex to any single file. To use this particular script, paste it into a new AppleScript document and save it as an Application. It will have a Application like icon with an arrow. This means the script is a droplet. To rename any single file, simply drop the file on top of this application's icon, and ...


0

The other option is if the machine is networked to an OSX server, use Workgropup Manager and define in the group settings. That will allow you set a time out. You can set the time out by the user or workgroup that you have the machine added too.


2

I don't think it's possible with AppleScript but it is with terminal-notifier: -sender ID The bundle identifier of the application that should be shown as the sender, including its icon. -appIcon URL The URL of a image to display instead of the application icon (Mavericks+ only) For example: terminal-notifier -title title -message message ...


0

Just loaded Hazel v3 on my Snow Leopard (10.6.8) and I noticed that it does a poor job of detecting when a file is busy. When I created a file like this... $ cat > fileXX In it's log it correctly says that file is busy but then gives up on it and moves it anyway....!? 2014-09-28 22:07:32.735 hazelworker[11272] Processing folder Test 2014-09-28 ...


0

You cannot open a .scpt file with any editor! It is a compiled version of the script, not text, and it will not open with any editor. Case in point, here is what happens when I try to view the file in Terminal... OSX comes with osadecompile that will extract the source code of a compiled script .scpt file. Here is an example... $ osadecompile ...


0

Easiest Way: Put all PDFs in one folder. Select All and Open. Make sure View -> Thumbnails is checked, so you can make sure everything is in correct order. Click File -> Print. In Print Window, click PDF -> Save as PDF.


0

This has been a goal for many an Applescripter for a long time. Not sure anyone has hit the holly grail without using a third party scripting app with a Spotlight indexer.. I have tried a few things in the past but this thread prompted me again to have another go. I now normally try and save all my applescripts in one places, in a Scripts folder in my ...


0

Keyboard Maestro. What you want to achieve requires a daemon that runs in the background, launches with the system, and executes customized commands/scripts after detecting a trigger. It's no a small feat if you want to write one that has good stability. Apart from the keys, Keyboard Maestro has triggers like Startup, System Wake, Login, While Logged In, ...


0

I can think of two: Extension names are meant to be associated with your application of choice. If you change your applescripts to be the default .txt app, you will be either opening up plain text with AppleScript Editor, or opening up applescripts with TextEdit when you double click. Of course you can resort to context menu, but some may consider it an ...


0

how to prompt the user for multiline input You can use the following AppleScript: display dialog "" default answer linefeed Source: How Can I Create a Multi-Line Input Dialog using Applescript? how to trigger the script on the user requesting a return to the login window This depends entirely on how the user is requesting this. You could use an ...



Top 50 recent answers are included