Tag Info

Hot answers tagged

4

I had a similar issue and the 'Fetching...' was taking many seconds. I just reset Launch Services with the following command: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed -r -f -v -domain local -domain user -domain system


3

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


2

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


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

Okay, I have made an app for this. It is on GitHub: 0942v8653/ScriptableStatusBar. Just keep the app running and use the sbar tool to set and remove items. As the readme says: sbar set face 😃 'Bye!:sbar remove face' Creates a face in the status bar. The menu will have an option Bye! that runs sbar remove face getting rid of the menu it creates. You ...


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

Another option is to use Rumps, a Python library that uses the Obj-C classes and functions. http://rumps.readthedocs.org/en/latest/


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

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

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

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'd try writing a simple script: #!/bin/bash sudo /usr/bin/id save this as something.command, change its permissions to executable with chmod +x, and then run this from AppleScript with osascript -e 'do shell script "open -a Terminal ./something.command"' Instead of /usr/bin/id you can call whatever script you need to run with admin privileges then. ...


1

You can use System Preferences/Energy Settings to define shutdown/restart times run sudo shutdown -r 23:45 to automatically reboot every night combine the second option with a cron/launchd job to reschedule the reboot daily (or just call shutdown -r now from cron/launchd) You also can set one user to auto-login after reboot in System Preferences/Users ...



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