Automator - 获取没有文件类型的已删除文件的名称


0

我有一个简单的automator应用程序,在它上面的文件上运行python脚本。但是,我还需要提取已删除文件的名称,以便我可以使用它来创建目录名称。

for f in "$@"
do
    set myFileName to name of (item f of $@)
    /usr/local/bin/python3 /Volumes/Scripts/script.py "$f"
    mkdir myFileName (without extension?)
done

Answers:


2

您的脚本的第一行是Applescript,而它应该是shell(默认情况下为bash)。我能想到的最简洁的版本:

for f in "$@"
do
    /usr/local/bin/python3 /Volumes/Scripts/script.py "$f"
    mkdir ${f%.*}
done
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.