Hello,
I have a workflow that I am trying to automate using KM.
I'm trying to copy a question and answer choice, then paste its parts into its respective Chrome browser fields.
I planned as follows:
A: Copy text to system clipboard.
B. Use the Search using Regular Expression action with grouping to isolate six parts of system clipboard.
RegEx 1: Text of question: ^1?[0-9]?[0-9]. (.+)$
RegEx 2: Text of answer choice a: ^a. (.+)$
RegEx 3: Text of answer choice b: ^b. (.+)$
RegEx 4: Text of answer choice c: ^c. (.+)$
RegEx 5: Text of answer choice d: ^d. (.+)$
RegEx 6: Answer letter. A, B, C, D, T, or F: ^Ans: ([ABCDTF])$
C. Paste the parts of the question and answers to the respective fields.
D. Use the RegEx 6 variable to select the appropriate Chrome browser answer radio button.
E. Click Submit.
F. I would then go to the next question/answer set and run the KM Marco again.
Here are three random example items to be copied:
1. Lorem ipsum dolor “sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt” duis aute ______.
a. *nulla pariatur*
b. *duis aute*
c. occaecat
d. minim veniam
Ans: B
23. Purus faucibus ornare suspendisse sed nisi lacus sed.
Ans: T
36. ______ cras sed felis eget. Diam vulputate ut pharetra sit amet.
a. Suspendisse
b. Volutpat
c. Sagittis
d. Morbi
Ans: B
So far, I'm stuck at the Search using Regular Expression action. I would be grateful for any help.
I can see your problem, so here's my input. Your first regex is a bit off, even though it seems to work so I've corrected it. I've created the correct forms for the Search using Regular Expression actions. On the whole you weren't all that far off. Have a look:
tiffle,
Wow. Thanks very much. Your Regular Expressions are simple and KM sees them just fine. And now that KM will assign values for the variables I can move forward with my project. I am look forward to learning more about Regular Expressions and all that they can do, especially in Keyboard Maestro.
It does help tiffle and I am grateful for your input.
I enjoy a good challenge, especially a RegEx challenge, and this problem presents me with that opportunity.
Below is a macro that provides a more generalized solution which can process multiple questions at once. I have a Comment Action where you can insert processing Actions for each Q&A.
It also:
Show How to Use Optional RegEx Capture Groups
Show How to Use KM Dynamic Variables
Example Source String
1. Question with 4 choices
a. one a
b. one b
c. one c
d. one d
Ans: B
4. True-False Question with no choices
Ans: T
2. Question with 3 choices
a. two a
b. two b
c. two c
Ans: C
3. Question with 2 choices
a. three a
b. three b
Ans: A
It's good that you have a project to work on as that's probably the best way to learn a new tool or technique. However, if you ever get stuck again - just ask!!
Thank you very much. Your responds is detailed and clear. I'm trying to simplify a tedious copy and paste process.
Copy a question, choices, and answer letter and use it to complete the corresponding Chrome fields on a Create/Edit Multiple Choice Question form in a LMS (Learning Management System) called Blackboard.
______ cras sed felis eget. Diam vulputate ut pharetra sit amet. Paste to question field in Chrome.
a. Suspendisse Paste to 1st answer field without letter.
b. Volutpat Paste to 2nd answer field without letter.
c. Sagittis. Paste to 3rd answer field without letter.
d. Morbi. Paste to 4th answer field without letter.
Ans: B Use to select the corresponding radio button.
Have KM select a checkbox in Chrome.
Have KM select an always the same dropdown box item in Chrome.
Have KM use the answer letter A,B,C or D to select the corresponding answer radio button.
Have KM click Submit and Create Another button.
I would copy next question by hand then run macro again.
The LMS's True/False form looks somewhat different. It only needs the question field completed and the one of two radio buttons selected True radio button or the False radio button. Then select Submit and Create Another button. I would copy next True False question and then run macro again.
You're welcome.
I did not see a question in your remaining post.
I think I have provided all of the KM Variables where you can do what you outlined.
Why don't you see if you can work with either the macro that @tiffle or I provided to automate your workflow. For simple, clarification questions, you can post back here.
But for more complicated questions, it would be best to post a new topic.