Tag Info

New answers tagged

0

Did you consider using Keyboard Maestro? Here is an example of how I deal with moving windows through screens. I just tried to move full screens apps -never tried before- and seems that didn't work well. But you could modify my macros to Exit full screen before moving to the next screen and Enter full screen after that. The macro for that is called Type a ...


1

Use key code instead of keystroke. I don't see why MouseTools is needed. Assuming you have cntrl-2 bound to space to, this should switch you (at least in Yosemite): tell application "System Events" key code 19 using control down end tell -- numkey code -- 1 18 -- 2 19 -- 3 20 -- 4 21


1

Open Automator, and choose 'Application' from the pane that appears. In the sidebar, there should be an item called 'Utilities'. Click this, and drag two 'Launch Application' actions into the main workflow pane. In the first one, choose the application you want to use with Spotify, and in the second one, choose Spotify. (See the picture below.) Then, ...


1

I answered my own question: If this script isn't working, go to System Preferences | Security & Privacy | Accessibility, and make sure that Script Editor is checked ON to allow Applescripts to control the GUI.


1

You can also use RubyCocoa: require "osx/cocoa" include OSX app = NSApplication.sharedApplication statusitem = NSStatusBar.systemStatusBar().statusItemWithLength(NSVariableStatusItemLength) statusitem.setTitle("aa") app.run


0

The in-n-out cannot be avoided with applescript, to my knowledge. tell application "System Events" do shell script "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control" delay 0.5 tell process "Dock" to tell group 1 to tell list 1 to tell button 1 to click delay 0.5 do shell script "/Applications/Mission\\ ...


2

I would suggest starting with this thread, which describes using Cocoa Objective-C calls from within AppleScript. There is an example Xcode project here. And Launch is a complete application written in AppleScript that functionally does this. Its Xcode project file is here. The basic premise is to generate NSMenuItem instances and add them to the system's ...


0

Yes, you can create a Cocoa app for this purpose in Xcode. No, you cannot do it with applescript.


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.



Top 50 recent answers are included