1

I have created a simple workflow in Automator to ask questions & send an email. I followed the tutorial at https://macmost.com/create-customizable-text-inserts-using-automator.html. This has worked for me in different usages, but in this workflow, I have an issue. Near the end of the workflow, multiple variables are retrieved using "Get Value of Variable" to create a message consisting of them all. As each variable is retrieved, it is added to the last variables. However, the last get value of the variable I use deletes all of the other variables which were previously shown in "results" and the result becomes only that variable.

I have attached an image for reference. As you can see it continues to increase (4 items, 5 items), but when the last variable is got, it deletes all of the other items & is set to 1 item.

I have tried deleting the ask for text/set variable for the last statement, and it results in the issue occurring on the "new" get value of variable.

Get variable stops appending

9
  • I just tested an Automator Workflow with 6 each, Ask for Text, Set Value of Variable and Get Value of Variable and the Results of the last Get Value of Variable contained the values the previous 5 and the value of the last one. So in my testing it didn't drop anything. That said, not sure this can be troubleshot unless you include the complete workflow and a set of test data the produces the error for you. Also what exact version of macOS are you running. This way we can test under the same conditions and see if we get the same results. Sep 1 '20 at 21:33
  • Also, if you could upload a copy of your Automator Workflow to a file sharing service, that would save us a lot of time trying to troubleshoot it. Sep 1 '20 at 21:35
  • dropbox.com/sh/kk3y746gam55eny/AAASB9Z1Zf-KE2PK_6Dkcb8wa?dl=0 @user3439894 Thank you! I have added the workflow here to assist in troubleshooting Sep 1 '20 at 21:50
  • I do not do much JavaScript, however, I noticed your Run JavaScript actions are not returning plain text strings. I'd try setting it so they do returns just a plain text string and see if that makes any difference. Sep 1 '20 at 22:26
  • Never mind, I added code for them to return plain text strings and it didn't make any difference. Sep 1 '20 at 22:37
0

Running your workflow unedited...

In the fifth Get Value of Variable action, when running the original workflow, its Results, with the list button selected, was, e.g.,:

(
  "<NSAppleEventDescriptor: [ 'utxt'("Hey") ]>",
  "What's Up?",
  "1-3",
  "<NSAppleEventDescriptor: [ 'utxt'("Full QA") ]>",
  "<NSAppleEventDescriptor: [ 'utxt'("aren't") ]>"
)

In the sixth Get Value of Variable action, when running the original workflow, its Results, with the list button selected, was, e.g.,:

(
  "<NSAppleEventDescriptor: [ 'utxt'("Thank you") ]>"
)

When it would have beed expected to be, e.g.,:

(
  "<NSAppleEventDescriptor: [ 'utxt'("Hey") ]>",
  "What's Up?",
  "1-3",
  "<NSAppleEventDescriptor: [ 'utxt'("Full QA") ]>",
  "<NSAppleEventDescriptor: [ 'utxt'("aren't") ]>"
  "<NSAppleEventDescriptor: [ 'utxt'("Thank you") ]>"
)

Just to test something out, I converted all the Ask for Text actions to Run AppleScript actions that did the same thing, and initially converted all but the last Run JavaScript actions to Run AppleScript action and everything worked.

I then converted the last remaining Run JavaScript action to Run AppleScript action and everything worked. I did this because of the differences in how each variable was being saved/returned. Thus by making all the variables the same type/class it worked.

In the fifth Get Value of Variable action, when running the edited workflow, its Results, with the list button selected, was, e.g.,:

{"Hey", "What's Up?", "1-3", "Full QA", "aren't"}

In the sixth Get Value of Variable action, when running the edited workflow, its Results, with the list button selected, was, e.g.,:

{"Hey", "What's Up?", "1-3", "Full QA", "aren't", "Thank you"}

As you can see in the example results what's returned is a plain list of text strings not mixed as in the output of the original workflow.

The end result was, e.g.,:

enter image description here

While I can not say for sure, nonetheless, it looks like there may be some sort of bug with the type/class count when stacking more than five Get Value of Variable actions and why it does not fail when all have been acquired, set and retrieved when done using the same type of actions.


Here is a link for the edited workflow: Send_QA_Mail_Test.zip

  • SHA1: dfdec5414d0d5e22c46ad444b7bb77f19b442a45
1
  • 1
    Thank you! This worked for me Sep 2 '20 at 19:46
-1

I had encountered same problem when some "Get Value of Variable"s were set after "Run AppleScript". enter image description here After all, I adopt workaround that is set "Run Shell Script" imedeatelly after "Run AppleScript". In "Run Shell Script" just execute "cat". enter image description here

1
  • This is not at all the same conditions as the issue of the OP, nor is it a solution to it either. Mar 6 at 16:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .