Python 如何循环自动机工作流?

Python 如何循环自动机工作流?,python,shell,loops,workflow,automator,Python,Shell,Loops,Workflow,Automator,因此,这些步骤是: 运行Applescript 询问查找项目 运行Shell脚本 询问查找项目 运行Shell脚本 索要文本 运行Shell脚本 1是一个对话框,2和4分别指定文件夹和文件。一旦指定了它们,我想重复使用6和7,因为7依赖于6的条目除非指定停止,否则是否有必要在完成7后返回到6时进行循环?我认为您可以将步骤1-5放在工作流a中,然后将最后一个“运行工作流”步骤放在工作流a中。然后您可以设置另一个工作流,B运行步骤6-7,然后执行“循环”操作,将继续连续运行步骤6-7 然而,如果这是

因此,这些步骤是:

  • 运行Applescript
  • 询问查找项目
  • 运行Shell脚本
  • 询问查找项目
  • 运行Shell脚本
  • 索要文本
  • 运行Shell脚本

  • 1是一个对话框,2和4分别指定文件夹和文件。一旦指定了它们,我想重复使用6和7,因为7依赖于6的条目除非指定停止,否则是否有必要在完成7后返回到6时进行循环?

    我认为您可以将步骤1-5放在工作流a中,然后将最后一个“运行工作流”步骤放在工作流a中。然后您可以设置另一个工作流,B运行步骤6-7,然后执行“循环”操作,将继续连续运行步骤6-7

    然而,如果这是我,我想我会把整个事情放在一个Applescript中(必要时嵌入到工作流中)。我不知道您的步骤的细节,但applescript的框架如下所示:

    -- Step 1: Run Applescript (* Insert whatever Applescript statements you require here *) -- Step 2: Ask for Finder Items -- https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/reference/aslr_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW4 set fileListA to choose file with multiple selections allowed -- Step 3: Run Shell Script set output to do shell script "echo 123" -- Step 4: Ask for Finder Items set fileListB to choose file with multiple selections allowed -- Step 5: Run Shell Script set output to do shell script "echo abc" repeat -- Step 6: Ask for Text -- https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/reference/aslr_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW12 set dialogResult to display dialog "Enter text" default answer "" -- Step 7: Run Shell Script set output to do shell script "echo XYZ" end repeat --步骤1:运行Applescript (* 在此处插入所需的任何Applescript语句 *) --步骤2:询问查找者项目 -- https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/reference/aslr_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW4 设置fileListA以选择允许多选的文件 --步骤3:运行Shell脚本 将输出设置为执行shell脚本“echo 123” --步骤4:询问查找者项目 设置fileListB以选择允许多选的文件 --步骤5:运行Shell脚本 将输出设置为执行shell脚本“echo abc” 重复 --第六步:索要文本 -- https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/reference/aslr_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW12 将dialogResult设置为显示对话框“输入文本”默认答案 --步骤7:运行Shell脚本 将输出设置为执行shell脚本“echo XYZ” 结束重复
    我认为您可以将步骤1-5放在工作流A中,然后将最后一个“运行工作流”步骤放在工作流A中。然后您可以设置另一个工作流B来运行步骤6-7,然后执行“循环”操作,该操作将继续连续运行步骤6-7

    然而,如果这是我,我想我会把整个事情放在一个Applescript中(必要时嵌入到工作流中)。我不知道您的步骤的细节,但applescript的框架如下所示:

    -- Step 1: Run Applescript (* Insert whatever Applescript statements you require here *) -- Step 2: Ask for Finder Items -- https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/reference/aslr_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW4 set fileListA to choose file with multiple selections allowed -- Step 3: Run Shell Script set output to do shell script "echo 123" -- Step 4: Ask for Finder Items set fileListB to choose file with multiple selections allowed -- Step 5: Run Shell Script set output to do shell script "echo abc" repeat -- Step 6: Ask for Text -- https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/reference/aslr_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW12 set dialogResult to display dialog "Enter text" default answer "" -- Step 7: Run Shell Script set output to do shell script "echo XYZ" end repeat --步骤1:运行Applescript (* 在此处插入所需的任何Applescript语句 *) --步骤2:询问查找者项目 -- https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/reference/aslr_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW4 设置fileListA以选择允许多选的文件 --步骤3:运行Shell脚本 将输出设置为执行shell脚本“echo 123” --步骤4:询问查找者项目 设置fileListB以选择允许多选的文件 --步骤5:运行Shell脚本 将输出设置为执行shell脚本“echo abc” 重复 --第六步:索要文本 -- https://developer.apple.com/library/mac/documentation/applescript/conceptual/applescriptlangguide/reference/aslr_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW12 将dialogResult设置为显示对话框“输入文本”默认答案 --步骤7:运行Shell脚本 将输出设置为执行shell脚本“echo XYZ” 结束重复