How to use current folder name without path as a variable in automator on Mac?

I am using Mac OSX 10.8.3.

I have a workflow in Automator that looks like this:

  • Query Search Items
  • Get folder contents
  • Make consistent
  • Move Finder Items

The goal of the workflow is to automate the renaming of the sequence of photos that I saved in folders and move them to a new folder.

I want to capture the folder name and paste it into a variable and use this variable in the "new name" field in the Make Sequential section of the workflow (see attached) image.

How to get the name of a folder and assign it to a variable. My example has a variable called "FolderName"

Here is a screenshot screen shot

+5
3

:

  • - .
  • - , 1.
  • Script - Pass: . /usr/bin/basename "$ 1" ,
  • - _ 3.
  • - ,

    5. 5, 4 - Ctrl + ,

  • - , Action 5

  • Finder - = _

enter image description here

Move , .

+10

Run Shell Script Action :

echo ${1##*/}

Pass input: as arguments.

enter image description here

, .

, FolderName.

0

, , , pdf pdf pdf. , , :

  • - .
  • - , 1.
  • Script - Pass: . echo ${1 ## */} ,
  • - _ , 3.
  • - , . 5, 4
  • - 5
  • PDF- . PDF- .
  • Finder. : > folderName.
0

All Articles