dongarey Posted February 17, 2015 Posted February 17, 2015 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
deanishe Posted February 19, 2015 Posted February 19, 2015 (edited) 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 February 19, 2015 by deanishe dongarey 1
dongarey Posted February 19, 2015 Author Posted February 19, 2015 Okay. For some reason my query is still not being passed into the script. After running it will paste whatever was on the clipboard before it ran.
deanishe Posted February 19, 2015 Posted February 19, 2015 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.
dongarey Posted February 19, 2015 Author Posted February 19, 2015 Ok. Here is what currently works: https://www.dropbox.com/s/grqu75iojwwugy7/MLV%202016.alfredworkflow?dl=0
deanishe Posted February 19, 2015 Posted February 19, 2015 Thanks, but I can't tell you what's wrong with a workflow that works… I need the broken new version. You probably want something that looks like this: dongarey 1
dongarey Posted February 20, 2015 Author Posted February 20, 2015 I did this the first time you mentioned it! The only thing that I hadn't done was to uncheck the Escaping: fields. It works great. Thank you!
dongarey Posted February 20, 2015 Author Posted February 20, 2015 Uploaded finished product to Packal. http://www.packal.org/workflow/mlv-2016-find-paste-scripture
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now