Jump to content

Accordance would be wonderfully fast to use, if......


countach

Recommended Posts

Typical workflow: You find a verse reference in a web page. Copy verse reference to pasteboard. Find Accordance window. Open new tab. Paste verse reference into GOTO field and press enter.

 

Wouldn't it be great if you could highlight the verse reference in Safari, hit F-1 or something, and BAM, Accordance is open already at that verse?

 

Extra bonus marks if it handles multiple verse ranges, though I'd prefer to be able to cycle through the verses in context, rather than singling them out with the search function.

 

Achieving this kind of thing is fairly straight forward in my experience. I've added this kind of functionality to apps in only a few hours work. I've attached below the code for obtaining the highlighted text in another application. Hotkeys to activate are made easier by the http://rogueamoeba.com/sources/ HotKeys library, and http://code.google.com/p/shortcutrecorder/ makes it easy for a user to select what hotkey they want. Feel free contact me if you want any info.

 

A lot of apps also have another hotkey for a GOTO on the contents of the pasteboard. Other options could be hotkeys to search on the currently selected text and so forth.

 

if (AXAPIEnabled()) {

AXError error = 0;

AXUIElementRef systemWide = AXUIElementCreateSystemWide();

 

AXUIElementRef app = nil;

if ((error = AXUIElementCopyAttributeValue(systemWide, kAXFocusedApplicationAttribute, (CFTypeRef *) &app)) != kAXErrorSuccess) {

NSLog(@"AXError1: %d", error);

return;

}

 

AXUIElementRef attr = nil;

if ((error = AXUIElementCopyAttributeValue(app, kAXFocusedUIElementAttribute, (CFTypeRef *)&attr)) != kAXErrorSuccess) {

NSLog(@"AXError2: %d", error);

return;

}

CFTypeRef value = nil;

if ((error = AXUIElementCopyAttributeValue(attr, kAXSelectedTextAttribute, &value)) != kAXErrorSuccess) {

NSLog(@"AXError3: %d", error);

return;

}

CFStringRef highlightedText = [value description];

}

Link to comment
Share on other sites

Well, first off, Accordance isn't written in Objective-C.

 

Secondly, there are numerous ways for a user to implement their own system-wide hot key activation for anything they want.

Quicksilver has been a popular one, and you can search for Quicksilver Actions that will do what you're asking with Accordance and much more. The scripts in that particular package can be modified to work with whatever you choose.

 

I used one of them to create a Services menu that does just what you asked, opens a new Accordance window with the selected verse reference from with in any other application (that is "Services-aware").

Link to comment
Share on other sites

Well, first off, Accordance isn't written in Objective-C.

 

Secondly, there are numerous ways for a user to implement their own system-wide hot key activation for anything they want.

Quicksilver has been a popular one, and you can search for Quicksilver Actions that will do what you're asking with Accordance and much more. The scripts in that particular package can be modified to work with whatever you choose.

 

I used one of them to create a Services menu that does just what you asked, opens a new Accordance window with the selected verse reference from with in any other application (that is "Services-aware").

 

Wouldn't it be great if that was built in to Accordance though? I would sure use it.

Link to comment
Share on other sites

The code I posted isn't objective-C. Everything I mentioned can be done in C, but probably a lot harder.

 

I tend to think Accordance should be slowly moving to objective-c, bit by bit before Apple abandon Carbon-gui, but they'll have to figure that out.

 

I didn't know Quicksilver could do this, so I'll have to look into that thanks.

Link to comment
Share on other sites

The most like way Accordance would support this natively would be through the Services menu mechanism.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...