Thursday, March 23, 2017

#1 2017-03-08 02:13:44 am

ffmac
Member
Registered: 2017-03-07
Posts: 1

Basic Folder Action....

Hello everybody!
I am new to Automator/ Apple Script and tried to program something for a friend of mine:
Folder "Source" with changing amount of subfolders. Content: Pictures.
The Program should do the following task: Check Folder "Source" for content, copy (Picture) content to different Folder "Target", then erase Subfolders in Folder "Source". thats it....

What i managed to do by now is a folder action and/ or an automator program checking folder "source", copy the pictures to "target" and thats it. Whenever i try to add the action "afterwards delete content of folder "source"" it ends up in a) pictures are in the trash or b) pictures copied, subfolders still in folder "source".

Can someone help?

Btw, what i "programmed":
- ask finder object
- check content of folder "source" (with subfolders)
- filter objects (kind is not folder)
- move filtered objects to Target folder (and erase content of target folder before)
- check content of folder
- filter objects (any kind of content)
- move content to trash

I appreciate any kind of help - thanks in advance and i hope my english is "read- and understandable"

Frank

Offline

 

#2 2017-03-17 04:13:59 pm

Nigel Garvey
Moderator
From: Warwickshire, England
Registered: 2002-11-19
Posts: 4218

Re: Basic Folder Action....

Hi. Welcome to MacScripter. (Somewhat belatedly, I'm afraid. The Automator forum doesn't get a lot of visitors.)

I can't get the filter action to work in Automator 2.6, but this works provided there's only one level of subfolders:

Ask for Finder Items. (Select "Folders" in the "Type:" pop-up.)
Get Folder Contents. (Leave "Repeat for each subfolder" unchecked.) Gets the subfolders.
Set Value of Variable. (Click the pop-up and enter a suitable name, perhaps "subfolders".) Memorises them,
Get Folder Contents. (Leave "Repeat for each subfolder" unchecked.) Gets the subfolders' contents.
Move Finder Items. (Set the destination folder.) Moves the contents to the destination folder.

Get Value of Variable. (Same variable name as above. Click "Options" and check "Ignore this action's input".) Gets the subfolders again.
Move Finder Items to Trash. Moves them to the trash.


NG

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.335 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)