Jump to content


Photo

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


  • Please log in to reply
4 replies to this topic

#1 countach

countach

    Silver

  • Active Members
  • PipPipPip
  • 134 posts
  • Gender:Male

Posted 09 March 2009 - 10:14 PM

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.c...ortcutrecorder/ 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];
}

#2 Joe Weaks

Joe Weaks

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,077 posts
  • Gender:Male
  • Location:Odessa, TX
  • Interests:I like things that are Orange, and possibly Blue.
  • Accordance Version:11.x

Posted 10 March 2009 - 01:18 AM

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").
Joe Weaks
The Macintosh Biblioblog

Sometimes I'm so helpful even I can't stand it.

#3 DanG

DanG

    Gold

  • Active Members
  • PipPipPipPip
  • 202 posts
  • Gender:Male
  • Location:Illinois
  • Accordance Version:10.x

Posted 10 March 2009 - 02:52 PM

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.

#4 countach

countach

    Silver

  • Active Members
  • PipPipPip
  • 134 posts
  • Gender:Male

Posted 12 March 2009 - 11:28 PM

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.

#5 Scott Knapp

Scott Knapp

    Platinum

  • Accordance
  • 1,130 posts
  • Gender:Male
  • Location:Orlando, FL
  • Accordance Version:10.x

Posted 13 March 2009 - 01:36 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users