Jump to content

Switch input to argument via keyword instead of hotkey

Recommended Posts

This workflow accesses a Bible program (Accordance) and searches it for the 'selected verse reference' then pastes the result.  It works fine. Instead of a hotkey, I want to be able to type a keyword such as 'find' then a verse reference and have the reference run through the script.  Tried some of the more obvious approaches, but it just won't work for me.





Current configuration is -----


>>>Selection in OSX- Hotkey


>>>Run Script-

global theResult

global moduleName
global input
global citationFormat
set moduleName to "MLV 2016" --NOTE: Change this to change what version you paste, i.e. ASV, but keep in mind it must be available in Accordance.
set input to (the clipboard)
set citationFormat to "true"
getScriptureText(moduleName, input, citationFormat)
on getScriptureText(moduleName, input, citationFormat)
tell application "Accordance" to set theResult to «event AccdTxRf» {moduleName, input, citationFormat}
tell application "System Events"
set visible of process "Accordance" to false
end tell
end getScriptureText
tell application "System Events"
set the clipboard to theResult
end tell
>>>Copy to Clipboard - {clipboard} - Paste to frontmost

Share this post

Link to post

You need to use a Keyword Input with Argument Required to trigger your workflow.

In your AppleScript, change set input to (the clipboard) to set input to "{query}".

Edited by deanishe

Share this post

Link to post

Could you post a screenshot of your workflow setup and the script code (in code tags, please)? Or better yet, upload the workflow somewhere.

It's hard to figure out what's going wrong when you don't have all the relevant information.

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...