For enabling some of my application's features, I need the user to add the application in the accessibility list:
I understand this is not possible to do it without any user interaction, but at least I would like to know two things:
How to know if the application is already in this list or not?
If application does not yet belong to the list, how to display this dialog:
I am using the last version of XCode and Objective-C.
Thank you for your help.
AXIsProcessTrustedWithOptions returns whether the current process is a trusted accessibility client. Option kAXTrustedCheckOptionPrompt indicates whether the dialog will be displayed.
Related
I've an idea to develop a modification to WhatsApp, for example now when I click attachment symbol it shows only 6 I want to add one more option to it. If it's possible let me know. I want to add more one button on Attach menu.
It is not clear what exactly you are asking.
You have an option to launch other applications from your app.
If you want to change the way a certain app looks, or behaves you have to write something similar to it for people to use, but you cannot change the original app (no one will let you)
Here you go! it's possible, as #Jef said in comments.
using documentation interaction controller.
https://www.whatsapp.com/faq/iphone/23559013
you need to work on how to hook into attachment menu.
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/
There is an assumption in your question that these other apps are put there by the whatsApp developers, or by a third party who was somehow able to modify their code. I suspect that what is happening is that they (whatsApp) simply export a document/file of a certain type (UTI) If your application supports that same UTI it should appear here. So there is six buttons for you, on your phone, but another user might see a different number, it depends entirely what they have installed on their device.
CONCEPTUAL.. if you double click on a file on your computer then the file browser (OS) opens that file with some application or other. Perhaps it is a .doc file and the OS pushes that file to word or pages. Or it may be a .psd file and it gets pushed to photoshop. How does this happen? The OS has a registry (database) of applications for each file type, applications sign up on this when they install/update. If you right click on a file you see an 'open in..' option that lists all your applications which can handle that file type, this is the menu that you are wanting to get onto (for whatsApp's file type) imho.
So you need to
1 ascertain what file type (UTI) WhatsApp is exporting
2 declare support for that file type in your application (this is the bit which will be platform specific solution) (iOS docs https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html#//apple_ref/doc/uid/TP40010411-SW1 )
**edit/addition
3. add the code to actually handle the file when your app receives it. On iOs this is in the appDelegate in
-(void) application: openURL: sourceApplication:annotation:
If the Whatsapp people have published an API then thats where you want to look. Good luck
I'm currently developing a custom dialog to be displayed via an Authorization Plugin, based upon the Apple example code of "NameAndPassword", which subclasses the SFAuthorizationPluginView (https://developer.apple.com/library/mac/#samplecode/NameAndPassword/Introduction/Intro.html)
From what I understand, this should allow me to provide different types of authorization / authentication, such as, for example, developing facial recognition for authentication. The problem I have is that when my dialog is launched by the authorization services, it is embedded in a parent dialog and there is additional text automatically added that states: -
"Type the name and password of the user in the "(null)" group to allow this".
After many hours searching the web, I have discovered that I can remove the "(null)" group section with an undocumented environment flag of "suggested-user" (https://devforums.apple.com/thread/180052?tstart=0)
...but text still remains prompting for a password.
In testing, I can launch other available plugin dialogs by calling from my mechanism of the rules in /etc/authorization and these dialogs do not appear to be attached to the parent dialog.
Does anyone know what I need to do to prevent the default text being displayed, or even better, how to have my dialog launched, independently from the parent dialog? Is this even possible with inheriting from SFAuthorizationPluginView?
Thanks.
I'm trying to build an app that get's selected text from other applications if a certain shortcut/hotkey is pressed. First I tried the Carbon Hotkey API, but then I couldn't get selected text from other applications. Second I've tried building a service that gets the selected text from other applications and is called with a global shortcut, but I wasn't able to use a custom shortcut. Somehow only CMD+SHIFT is allowed as a modifier in the plist and these kind of shortcut is already used in many applications so it's often not working. CTRL and a key would be a cool shortcut, because not many applications use this kind of shortcut, but I can't specify such a modifier.
Any Ideas how to solve this problem?
To answer your second question, you can manually edit the Services plist file. Find details here:
Set Custom KeyEquivalent in Services Menu
I want to create a global shortcut for my app. I've used the 'cool new way' of doing this with the addGlobalMonitorForEventsMatchingMask method. The problem is, my events don't get "consumed": my shortcut includes the spacebar, so whenever I use the shortcut, Quicklook pops up when I'm in the Finder.
How can I prevent this from happening? I know it's possible, because many apps, for example the Bowtie iTunes controller app, do it.
addGlobalMonitorForEventsMatchingMask: is not a suitable replacement for the existing Carbon Hotkey API for all sorts of reasons; it's horribly inefficient, for one. And from the docs:
... you can only observe the event; you cannot modify or otherwise prevent the event from being delivered to its original target application.
and
Key-related events may only be monitored if accessibility is enabled or if your application is trusted for accessibility access
The Hotkey API is still the only way to implement global shortcut in OS X. But unlike many Carbon APIs, the Hotkey API is available to 64-bit apps.
Use the hotkey API, which is meant for this purpose.
Is there a way to determine whether the active window (not of my process, but a different application) is resizable?
Edit: I would prefer to do this without applescript as it then depends on the application being scriptable.
Use Accessibility. Once you find the window you want to examine, test whether it has the kAXGrowAreaAttribute attribute (the value for which would be the grow area itself, a.k.a. the “size box” or [the Windows term] “resize handle”). A window that has one is resizable; a window that doesn't have one is not resizable.
The user will need to have access for assistive devices turned on, but making that happen is easier than scripting unscriptable applications.
Edit from the year 2011: Lion killed off size boxes, so now you'll need to test whether the window's size attribute can be changed.
Yes, you can check if the "frontmost window" of the target application is resizable! You can perform the scripting request via applescript, scripting bridge or a third party framework!
However, in any case, it's needed that the target application is scriptable and you can access to the "resizable" property (of the "frontmost window" object) via a scripting request!
Depends on how you're getting access to the window. There's a property in AppleScript on Window objects, resizable, that indicates this.