简体   繁体   中英

using an output from AppleScript as input to a Shell Script in Automator

I'm using Apple Automator, and in my workflow, I have a "Run AppleScript". I would like to present the user with a list of items:

on run
    choose from list {"DRNyheder", "DR1", "DRVejret", "ditbt", "ekstrabladet"} with prompt "Please make your selection" without multiple selections allowed and empty selection allowed
    set aName to item 1 of the result
    display dialog aName
    return aName
end run

The next item in the pipeline is a "Run Shell Script". In this case it's a python script. The idea is that I want to supply the output of the AppleScript as argv 1. I have verified that the AppleScript is returning a string, just like I expect.

/Users/fred/my_script.py $@

The problem is, I don't see that the argument is being passed to my Python script. Can anybody help?

If it helps, here is a screen shot of this part of the workflow:

在此处输入图片说明

Ok, this was embarrassingly easily. As it turns out, there's a setting in the upper-right hand corner of the Shell Scripts window, where you can pass inputs "as arguments". That's the ticket.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM