circuitrider Posted November 9, 2014 Share Posted November 9, 2014 (edited) When using services to paste a verse the verse is automatically highlighted. This makes it necessary to mouse click or press an arrow key to remove the highlighting. If this is not done, pressing return or trying to immediately type will erase the newly inserted selection. Is there a way to have the highlighting removed automatically? Edited November 9, 2014 by circuitrider Link to comment Share on other sites More sharing options...
Joe Weaks Posted November 9, 2014 Share Posted November 9, 2014 Some apps that the Service pastes in will leave the inserted text highlighted, and some apps won't. If you want to force that, you can add a right arrow at the end of the Service workflow. One way to do it would be to open the Service in Automator, then drag a new Run Applescript action to the end of the workflow. The text of the script would be: on run {input, parameters} tell application "System Events" to key code 124 end run Link to comment Share on other sites More sharing options...
circuitrider Posted November 11, 2014 Author Share Posted November 11, 2014 Joe, Thank you for the tip. I added the new script and now no verse is inserted at all. Here is what I have. http://www.accordancebible.com/forums/uploads/post-29527-0-94931600-1415674632_thumb.png Did I do it right? Link to comment Share on other sites More sharing options...
Joe Weaks Posted November 11, 2014 Share Posted November 11, 2014 Yes, that won't do it. A Service like this is set up to replace the current selection with whatever is returned by the last action in the Service workflow. It used to be the "Get Text from Accordance" result, which was the full text citation you wanted. But, now that we've added the Applescript key-command action, the last action is something else, which actually returns nothing. So, it doesn't work as is. Sorry I led you astray. You'd have to use the "Copy to Clipboard" action after the "Get Text..." action, and then have your Applescript action paste the text instead of doing the arrow right. tell application "System Events" to keystroke v using command down This seems like a lot of fuss to avoid hitting the arrow key to collapse the selection in the apps that it's necessary. Link to comment Share on other sites More sharing options...
circuitrider Posted November 11, 2014 Author Share Posted November 11, 2014 This seems like a lot of fuss to avoid hitting the arrow key to collapse the selection in the apps that it's necessary. Yes, I have to agree. Now that I have the new Get Verses action working for me I'll be using that. Thank you for offering a solution though. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now