Correct Recursive Script Duplication

Idea created by chivalry on Mar 29, 2016
    • hbrendel
    • chivalry
    • l_allen_poole

    When a script calls itself recursively and that script is copied and pasted, the pasted version is also recursive. The `Perform Script` steps that originally referred to the original script now refer to the pasted script.


    This doesn't work when duplicating a script (Cmd-D while it's selected). Instead, the duplicated script refers to the original script. As a concrete example, assume there's a script called "Script" that has a single step, `Perform Script [ "Script" ]`. If I copy and paste the script, I get "Script 2" that has a single step, `Perform Script [ "Script 2" ]`. If I duplicate the script, however, I get a new script "Script Copy" with a single step that still calls the original script, `Perform Script [ "Script" ]`.


    Personally, I can't imagine wanting a duplicated recursive script to continue to call the original script instead of retaining its recursive nature. Perhaps such situations do exist, which is the reason for the difference in Cmd-C/Cmd-V vs. Cmd-D?