Screen_Shot_2017-01-05_at_8_48_27_PM.jpg
#!/usr/local/bin/python3import sysimport osfor f in sys.stdin: filename = f.strip() if os.path.isfile(filename): # some operations here print(os.path.basename(filename)) else: print("Image {} not found!".format(filename))复制代码保存脚本并添加可执行权限。为了看到执行结果,可以添加Display Notification动作,同时可以插入一个Set Value of Variable来传递脚本输出的结果: