Jump to content

Small change to Services


circuitrider

Recommended Posts

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 by circuitrider
Link to comment
Share on other sites

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

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?

post-29527-0-94931600-1415674632_thumb.png

Link to comment
Share on other sites

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

 

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...