Hi Alfredo,

I wonder if a solution here is rsync.
This is a command line app that can easily be run from AppleScript.  It 'syncs' 
two directories, a source to a dest (in your case alpha (pre-production) to 
beta (production))

rsync -avu '/path/to/alpha/directory' '/path/to/beta/directory'

This will update all modified files and add new files from  from alpha to beta. 
 It will not delete items from beta when items are deleted from alpha.  To 
achieve that...

rsync -avu --delete '/path/to/alpha/directory' '/path/to/beta/directory'

The added --delete option only affects beta, not alpha

Explainer for -avu options
a: 'archive mode' makes sure things like creation date and mod dates are passed 
from alpha to beta
v: 'verbose' show a lot of feedback
u: skip files in beta that are newer than those in alpha. (ie saves time)

Ordinarily you do all that in Terminal, which you can call from BBedit.
But you can also run it from AppleScript:

do shell script "rsync -avu '/path/to/alpha/directory' 
'/path/to/beta/directory'"

Your workflow may have other nuances not captured above, but based on your 
notes, you might be able to replace an elaborate sequence of Automator and 
AppleScript with a single line of code easily run from within BBedit

> On Mar 19, 2021, at 17:32, F. Alfredo Rego <[email protected]> wrote:
> 
> My workflow involves copying an updated library from a pre-production (alpha) 
> directory to a production (beta) directory whenever the alpha software passes 
> some tests, which are part of an AppleScript that I run by means of a 
> convenient BBEdit shortcut.
> 
> My desired workflow is a work-around for an obvious Automator failing in 
> "Copy Finder Items.
> 
> "Copy Finder Items” watches a folder and, whenever a file is ADDED to the 
> folder (see the red rectangle that I used to highlight this spec), it copies 
> the file to a destination folder (with the option to replace existing items).
> 
> 
> 
> 
> Unfortunately, "Copy Finder Items” does NOTHING whenever a file is MODIFIED 
> (which is what happens every time that the library gets rebuilt during the 
> compile-link workflow).
> 
> So, I need (thanks, Automator ;-) to delete the library BEFORE running the 
> compile-link process, to guarantee that Automator will detect the “ADDITION" 
> of the brand-new library.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/45E84CBC-4938-41E7-A9FF-CA0AF9BF0D3F%40gmail.com.

Reply via email to