macos-sierra

Mac : Launch command when device connected by bluetooth

和自甴很熟 提交于 2019-12-06 13:43:22
I would like to launch a shell command when a specific external bluetooth device is connected to my Mac. A nice way (without installing third party software) to do that is by adding a plist file in ~/Library/LaunchAgents On this page , there is an example of launching an event when the wifi connects to a specific location. It is done by watching a specific file : <key>WatchPaths</key> <array> <string>/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist</string> </array> Do you think it'd possible to do the same with bluetooth events ? Thanks for your help ! iero Create

Update list of Midi Devices in Java

不羁岁月 提交于 2019-12-06 13:17:03
I work on a MIDI-based project in Java and struggle to refresh the list of Midi Devices. As far as i know MidiSystem.getMidiDeviceInfo(); should give me an Info[] Array. Nothing happens for me however. The Objects inside the Array stay the same when new devices are plugged in or out and so is it's length. Searching Stackoverflow brought me to this 6 year old question . One of the comments suggests, that being on OSX/macOS might be the issue. I haven't tried my program on Windows or Linux yet, but it should work on OSX/macOS anyways. Another comment suggests setting the cache time to something

malformed mach-o image: symbol table underruns __LINKEDIT

风格不统一 提交于 2019-12-06 03:55:27
Using the new Xcode 8 GM build on the GM of macOS Sierra, I've recompiled a Qt 5.7 C++ project and I'm getting the following error message when trying to launch the app: Reason: no suitable image found. Did find: /path/to/my/lib/libio_core.dylib: malformed mach-o image: symbol table underruns __LINKEDIT This doesn't occur on debug builds, only release. Does anyone have an idea as to what this means and how to go about fixing it? Update: This actually has nothing to do with Xcode 8. Building the same code with Xcode 7.3.1 results in the same outcome. It seems some apps that ran just fine on El

Access web browser tabs programmatically | Swift 3

偶尔善良 提交于 2019-12-06 01:29:05
Is it possible to access the open tabs of Safari or Google Chrome? A URL would be good or the title of the tab or both? The purpose of the app then the user could specify some websites and add labels to them and the app would measure how much is spent on those websites, the app would be allowed through accessibility. Use an AppleScript to get the title and the URL of each tab. You can use NSAppleScript in Swift to run an AppleScript. An example ( Safari ) let myAppleScript = "set r to \"\"\n" + "tell application \"Safari\"\n" + "repeat with w in windows\n" + "if exists current tab of w then\n"

Error Relating to AppTranslocation in macOS Sierra

霸气de小男生 提交于 2019-12-06 00:09:39
It would appear that Gatekeeper in macOS Sierra is a bit pickier. At any rate, it is causing a small utility I made some years ago to throw a rather annoying error. As I haven't yet had the time to dig into the under-the-hood changes in Sierra, I'm not sure how to fix the error. Does anyone have experience dealing with errors relating to AppTranslocation and fixing them? Code and error follow: Code : tell application "Finder" set currentDir to POSIX path of ((container of (path to me)) as text) end tell set currentDir to quoted form of currentDir set lib80211 to quoted form of "AirPort Utility

NSToolbarItem: “Make sure this toolbar item has a valid frame/min/max size”?

只愿长相守 提交于 2019-12-05 19:16:25
问题 Since upgrading to Mac OS Sierra and the new XCode version I get the following error every time I launch my application for every one of the NSToolbarItems: Example 1: 2016-09-29 12:46:58.659879 AppTest[] NSToolbarItem (<NSToolbarItem: >) had to adjust the size of <NSPopUpButton: > from {130, 26} to the expected size of {132, 27}. Make sure that this toolbar item view has a valid frame/min/max size. This is an app bug, please do not file a bug against AppKit or NSToolbar! Break on

pyinstaller No module named pyinstaller

浪尽此生 提交于 2019-12-05 14:43:59
问题 I have 2 python versions installed under my mac osx sierra: python 3.5 python 2.7 I installed pyinstaller under python3.5 with this command: python3.5 -m pip install pyinstaller If I run again the same command I'm getting: Requirement already satisfied: pyinstaller in ./lib/python3.5/site-packages Requirement already satisfied: setuptools in ./lib/python3.5/site-packages (from pyinstaller) That to me means that is is installed under python 3.5 and ready to be used. When I run this command:

managedObjectContext in Swift 3

 ̄綄美尐妖づ 提交于 2019-12-05 13:59:06
问题 I want to work through this example code in which Swift and CoreData is used to create a table. However, using Swift 3 I fail to get it to work. Most importantly, I cannot properly replace the line // set up the NSManagedObjectContext let appDelegate = NSApplication.sharedApplication().delegate as! AppDelegate managedContext = appDelegate.managedObjectContext even though I found this related question (which however is iOS not OS X). How can I replace that piece of code which produces the

gdb os x sierra 10.12.3 not working

喜你入骨 提交于 2019-12-05 08:07:10
问题 the problem is already known, that gdb doesn't work with OS X Sierra anymore. This is really annoying, since I researched already about the solution, and there were some solutions, but they apparently don't work anymore. I tried to use the .gdbinit file solution and the disable csrutil solution, both doesn't work. Sooo my question is: Does anyone know how to fix it in 10.12.3 ? Thank you very much! 回答1: Looks like there still isn't a solution to this. I don't think "use LLDB instead of GDB"

Observe for new System Notifications OSX

五迷三道 提交于 2019-12-05 04:50:24
Is it possible to listen/observe for new notifications macOS receives? I mean like when a new iMessage or a Slack message is received (so basically everything that causes NotificationCenter to display a Notification) Short answer: It is not possible. You can't observe user notifications sent by applications unless an application provides a specific API. For example the AppleScript dictionary of iMessage and Mail contains events scripts can respond to. However user notifications are encapsulated in the target application. There is a global notification class named DistributedNotificationCenter