How do I use the current folder name without a path as a variable in automator in Mac?

后端 未结 2 1062
天命终不由人
天命终不由人 2021-02-08 02:58

I am using Mac OSX 10.8.3.

I have a workflow in Automator set up that is as follows:

  1. Ask for Finder Items
  2. Get Folder Contents
  3. Make Sequen
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-08 03:32

    You can use a Run Shell Script Action, with the following code:

    echo ${1##*/}
    

    and Pass input: set to as arguments.

    enter image description here

    This will filter the passed input, giving only the file basename as output.

    You should put this step before the action that sets FolderName variable.

提交回复
热议问题