[HTML payload içeriği buraya]
28.2 C
Jakarta
Sunday, November 24, 2024

applescript – Find out how to create a folder motion that copies itself into new sub-folders?


I am indexing my mac with the colour tags and I need a folder motion to repeat itself into new sub-folders so it robotically retains tagging sub-folders.

Which fields precisely have to be specified?

Find out how to inform the TargetFolder is the final new created or positioned folder inthe ParentFolder?

I do not need it to promt however simply to let it assign a selected folder motion.
This script I discovered within the library:

property ChooseScriptPrompt : “Choose compiled script file(s) containing folder actions”
property ChooseFolderPrompt : “Choose a folder to connect actions”
property ErrorMsg : ” will not be a compiled script. (Ignored).”

on open DroppedItems
select folder with immediate ChooseFolderPrompt
set TargetFolder to the outcome as textual content
inform utility “Finder” to ¬
set FAName to call of alias TargetFolder
inform utility “System Occasions”
if folder motion FAName exists then
–Do not make a brand new one
else
make new folder motion ¬
at finish of folder actions ¬
with properties {path:TargetFolder} — title:FAName,
finish if
finish inform

repeat with EachItem in DroppedItems
    set ItemInfo to data for EachItem
    if not folder of ItemInfo then
        set FileTypeOfItem to file sort of ItemInfo
        set FileExtensionOfItem to call extension of ItemInfo
        set ItemName to call of ItemInfo
        if FileTypeOfItem is "osas" or FileExtensionOfItem is "scpt" then
            inform utility "System Occasions"
                inform folder motion FAName
                    make new script ¬
                        at finish of scripts ¬
                        with properties {title:ItemName}
                finish inform
            finish inform
        else
            show dialog ItemName & ErrorMsg with icon warning
        finish if
    finish if
finish repeat

finish open

on run
my ChooseFileFromFAScriptFolder()
open the outcome
finish run

to ChooseFileFromFAScriptFolder()
attempt
set LibraryScripts to checklist folder (path to Folder Motion scripts folder from native area) with out invisibles
on error
set LibraryScripts to {}
finish attempt
attempt
set UserScripts to checklist folder (path to Folder Motion scripts folder from consumer area) with out invisibles
on error
set UserScripts to {}
finish attempt
if (rely LibraryScripts) + (rely UserScripts) is larger than 0 then
set ChosenScripts to select from checklist LibraryScripts & UserScripts with immediate ChooseScriptPrompt ¬
with a number of choices allowed
if class of ChosenScripts is boolean then
error quantity -128
else
set SelectedScripts to {}
repeat with EachScript in ChosenScripts
if EachScript is in LibraryScripts then
copy alias ((path to Folder Motion scripts folder from native area as Unicode textual content) & EachScript) to finish of SelectedScripts
else if EachScript is in UserScripts then
copy alias ((path to Folder Motion scripts folder from consumer area as Unicode textual content) & EachScript) to finish of SelectedScripts
finish if
finish repeat
return SelectedScripts
finish if
finish if
return {}
finish ChooseFileFromFAScriptFolder

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles