Cocoa: Global Shortcuts in Lion - cocoa

I've been looking for a way to implement a global shortcut for my app that would work like shortcut recorder. The problem is I haven't found one that works with the current version of xcode, every single one I've found throws an error in xcode about legacy stuff. The only one i've found that is any good in Lion is DDHotKey, which does exactly what I want, but it has the downside that the user doesn't record the shortcut in a nifty smart textfield sort of thing, its a preset shortcut.
Can anyone tell me how to add a smart textfield to DDHotKet, or a fix for SR in Lion? It seems that for ShortcutRecorder the specific problem has to do with the actual textfield in IB using old plug-ins, so I can't use the text field (which is what I really want). I've looked up a whole bunch of different frameworks but they all have outdated stuff. To be honest even if I found a fix for running SR I still have no idea what to do since it seems to be waaay more complicated than all the others i've found.

This fork of ShortcutRecorder builds in Xcode 4:
https://github.com/youknowone/shortcutrecorder
It also has a nice demo project that shows how to use the API.

Related

Make VoiceOver announce text pre-10.9

I want VoiceOver to speak some text in an NSTextView that it won't say spontaneously, basically text added programmatically while the view has focus. OS X 10.9 added the NSAccessibilityAnnouncementRequestedNotification API as a way to do this (although it for some reason says macOS 10.7+ on the Apple documentation page), but I want my app to work on 10.7 as well.
EDIT: I made the code using NSAccessibilityAnnouncementRequestedNotification compile and run on 10.7 (by adding a number of missing definitions), but it seems to have no effect prior to 10.9.
I think I've worked out a way to trick VoiceOver into thinking that the text I want it to speak is selected, (basically returning the string and the range I want to be read when asked for the NSAccessibilityAttributedStringForRangeParameterizedAttribute or NSAccessibilitySelectedTextRangeAttribute) and then post a NSAccessibilityValueChangedNotification. This pretty much works, but makes VoiceOver say "Selection Replaced" whenever the user starts typing anything in the text view, on any OS newer than 10.7.
So, my question is: Is there a better way to do what I want?

Xcode [8] Editor scrolls on its own?

EnvironmentXcode 8MacOS 10.11.6MacBook Air (circa 2013)
ProblemI've noticed recently that the Editor in Xcode seems to periodically scroll-up on its own. Which I, at least, find very annoying.
I've looked at a couple of other postings:
Xcode scrolls text while typing
XCode auto-scroll when pressing Command after a text selectionBut neither of them seem to provide a solution for me, as I'm not pressing the Command key and I'm not using multiple fingers on the touch-pad.
It seems to happen most frequently when I'm working on code near the bottom of the file, I haven't been able to narrow down the cause-and-effect scenario more than that just yet.
Query
Has anyone else noticed this?
Has anyone figured out a way to stop it?
Is there a reasonable way to report this to Apple? There doesn't seem to be an Xcode section on the http://www.apple.com/feedback/ site.
Try to disable your XCode theme if you have one. We ended up with that bug by doing this trick!
For XCode 10.1 changing the font size to 12 for the selected theme did the trick.

Xcode 4.2 and new Tabbed Application Project

Can anyone help with Xcode 4.2 and the new tabbed application project? With Xcode 4.2, i create a new tabbed bar application, and it works as desired. However, it seems that instead of creating a new window and main.xib file that contains the tabviewcontroller, it sets everything in code within the appDelegate.
its easy to work with the tabbarcontroller via code and i have no problems setting up other tab items, however, i feel that my iOS development skills (they are new) are missing something as i would NOT even know if it was still possible to work with the tabviewcontroller graphically now in the way this project template has been setup.
Is there a way to work with the tabviewcontroller graphically? would i have to create a new main.xib file and link everything up to that? i'm still not strong enough in my skills to work out all the minute details but if that is the path that people suggest, i will look into it and try to figure it out.
I only want to work this out so i can fully understand whats going on now with Xcode 4.2, I have no unrelenting desire to only work with the tab bar controller graphically, but am curios as to why i cannot find it (or if i should)... just trying to get my head around how these things should be working.
You should use the Single-View Application template.
HEre you can add graphically that control

Port storyboard to iOS4

I'm a fan of Xcode's new storyboarding, but I'm annoyed it won't work on iOS4. I understand why it won't work, because it relies on new classes added to the iOS5 framework. However, it would be cool to be able to port a storyboard back to iOS4 somehow. A tool that outputted xib files for the individual stories, and code generation for segues.
If anyone knows of anyone else doing something in this area, I'd be interested in using it, since my app needs to support iOS4, but I'd like to move forward with Storyboarding. Can i have my cake and eat it too?
Nope you cant. Ended up gutting the storyboarding and going back to individual xibs.

Mac - iTunes status indicator thing

I don't know what to call it, but you know that greenish thing covering most of the middle of the top of the iTunes window, that shows the apple symbol or shows the music slider or the status etc., what is it? I've seen several other applications using it -- how do you get it? I couldn't find it in Interface Builder.
Thanks.
It's not available as a standard component (yet). iTunes is not even a Cocoa app (well, some part of it is Cocoa, but not much.). A few other Apple apps have similar interface element, so let's hope it'll become available in the next version.

Resources