Google Apps Script Library and Script Distribution





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















i was wondering if there is a possibility to distribute my Custom Script to all the sheets in my workspace. I came upon different ways with libraries or Add-ons, but they all lack some points i want to accomplish.




  1. I want it to be private only for my Google Account

  2. I need it to run the onOpen(e) Trigger for every File on my Sheets Account
    (So i can add a custom menu to all my Files)

  3. I also need to set a time Trigger for each File so my main() Function runs every night (right now i always create a new trigger when i rerun my main Function)


So far i can use the Library Option and create a new Script for all my Files and call my Main Function out of that Library. This Workaround does not include an onOpen Trigger event. When i use the Ability of run->test as addon and manually add all new Files (which come up every new month) i also lack the possibility of trigger functions.



If you have Solution Ideas I'd be very happy.



BR NJ










share|improve this question





























    1















    i was wondering if there is a possibility to distribute my Custom Script to all the sheets in my workspace. I came upon different ways with libraries or Add-ons, but they all lack some points i want to accomplish.




    1. I want it to be private only for my Google Account

    2. I need it to run the onOpen(e) Trigger for every File on my Sheets Account
      (So i can add a custom menu to all my Files)

    3. I also need to set a time Trigger for each File so my main() Function runs every night (right now i always create a new trigger when i rerun my main Function)


    So far i can use the Library Option and create a new Script for all my Files and call my Main Function out of that Library. This Workaround does not include an onOpen Trigger event. When i use the Ability of run->test as addon and manually add all new Files (which come up every new month) i also lack the possibility of trigger functions.



    If you have Solution Ideas I'd be very happy.



    BR NJ










    share|improve this question

























      1












      1








      1








      i was wondering if there is a possibility to distribute my Custom Script to all the sheets in my workspace. I came upon different ways with libraries or Add-ons, but they all lack some points i want to accomplish.




      1. I want it to be private only for my Google Account

      2. I need it to run the onOpen(e) Trigger for every File on my Sheets Account
        (So i can add a custom menu to all my Files)

      3. I also need to set a time Trigger for each File so my main() Function runs every night (right now i always create a new trigger when i rerun my main Function)


      So far i can use the Library Option and create a new Script for all my Files and call my Main Function out of that Library. This Workaround does not include an onOpen Trigger event. When i use the Ability of run->test as addon and manually add all new Files (which come up every new month) i also lack the possibility of trigger functions.



      If you have Solution Ideas I'd be very happy.



      BR NJ










      share|improve this question














      i was wondering if there is a possibility to distribute my Custom Script to all the sheets in my workspace. I came upon different ways with libraries or Add-ons, but they all lack some points i want to accomplish.




      1. I want it to be private only for my Google Account

      2. I need it to run the onOpen(e) Trigger for every File on my Sheets Account
        (So i can add a custom menu to all my Files)

      3. I also need to set a time Trigger for each File so my main() Function runs every night (right now i always create a new trigger when i rerun my main Function)


      So far i can use the Library Option and create a new Script for all my Files and call my Main Function out of that Library. This Workaround does not include an onOpen Trigger event. When i use the Ability of run->test as addon and manually add all new Files (which come up every new month) i also lack the possibility of trigger functions.



      If you have Solution Ideas I'd be very happy.



      BR NJ







      javascript google-apps-script






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 14:32









      NJ85NJ85

      61




      61
























          1 Answer
          1






          active

          oldest

          votes


















          2















          • An Add-on can be published privately. Private Add-ons

          • A Library is private by default - The only way that someone outside of your account can use your script as a library, is to set the file sharing to allow them to use it. Gaining access to a library

          • A Library can not run a simple trigger, but an Add-on can. The reserved function name onOpen() can't be triggered by a library. See Table - Resource Scoping

          • An Add-on can run the onOpen() function

          • An Add-on can create an add-on menu.

          • An Add-on can create one time-based trigger for each document it is installed in. Quote: "Each add-on can only have one trigger of each type, per user, per document" Add-on Restrictions


          If you want to do something like overwrite an Apps Script file, that can be done with the Apps Script API. Even script projects that are bound to a document (Sheets, Forms, Docs) can be overwritten with the Apps Script API.



          StackOverflow answer - Update an Apps Script file using Apps Script



          You can also update the manifest file of an Apps Script file using the Apps Script API, and therefore, programmatically add a library, and the library version to an existing Apps Script File.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53459203%2fgoogle-apps-script-library-and-script-distribution%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2















            • An Add-on can be published privately. Private Add-ons

            • A Library is private by default - The only way that someone outside of your account can use your script as a library, is to set the file sharing to allow them to use it. Gaining access to a library

            • A Library can not run a simple trigger, but an Add-on can. The reserved function name onOpen() can't be triggered by a library. See Table - Resource Scoping

            • An Add-on can run the onOpen() function

            • An Add-on can create an add-on menu.

            • An Add-on can create one time-based trigger for each document it is installed in. Quote: "Each add-on can only have one trigger of each type, per user, per document" Add-on Restrictions


            If you want to do something like overwrite an Apps Script file, that can be done with the Apps Script API. Even script projects that are bound to a document (Sheets, Forms, Docs) can be overwritten with the Apps Script API.



            StackOverflow answer - Update an Apps Script file using Apps Script



            You can also update the manifest file of an Apps Script file using the Apps Script API, and therefore, programmatically add a library, and the library version to an existing Apps Script File.






            share|improve this answer




























              2















              • An Add-on can be published privately. Private Add-ons

              • A Library is private by default - The only way that someone outside of your account can use your script as a library, is to set the file sharing to allow them to use it. Gaining access to a library

              • A Library can not run a simple trigger, but an Add-on can. The reserved function name onOpen() can't be triggered by a library. See Table - Resource Scoping

              • An Add-on can run the onOpen() function

              • An Add-on can create an add-on menu.

              • An Add-on can create one time-based trigger for each document it is installed in. Quote: "Each add-on can only have one trigger of each type, per user, per document" Add-on Restrictions


              If you want to do something like overwrite an Apps Script file, that can be done with the Apps Script API. Even script projects that are bound to a document (Sheets, Forms, Docs) can be overwritten with the Apps Script API.



              StackOverflow answer - Update an Apps Script file using Apps Script



              You can also update the manifest file of an Apps Script file using the Apps Script API, and therefore, programmatically add a library, and the library version to an existing Apps Script File.






              share|improve this answer


























                2












                2








                2








                • An Add-on can be published privately. Private Add-ons

                • A Library is private by default - The only way that someone outside of your account can use your script as a library, is to set the file sharing to allow them to use it. Gaining access to a library

                • A Library can not run a simple trigger, but an Add-on can. The reserved function name onOpen() can't be triggered by a library. See Table - Resource Scoping

                • An Add-on can run the onOpen() function

                • An Add-on can create an add-on menu.

                • An Add-on can create one time-based trigger for each document it is installed in. Quote: "Each add-on can only have one trigger of each type, per user, per document" Add-on Restrictions


                If you want to do something like overwrite an Apps Script file, that can be done with the Apps Script API. Even script projects that are bound to a document (Sheets, Forms, Docs) can be overwritten with the Apps Script API.



                StackOverflow answer - Update an Apps Script file using Apps Script



                You can also update the manifest file of an Apps Script file using the Apps Script API, and therefore, programmatically add a library, and the library version to an existing Apps Script File.






                share|improve this answer














                • An Add-on can be published privately. Private Add-ons

                • A Library is private by default - The only way that someone outside of your account can use your script as a library, is to set the file sharing to allow them to use it. Gaining access to a library

                • A Library can not run a simple trigger, but an Add-on can. The reserved function name onOpen() can't be triggered by a library. See Table - Resource Scoping

                • An Add-on can run the onOpen() function

                • An Add-on can create an add-on menu.

                • An Add-on can create one time-based trigger for each document it is installed in. Quote: "Each add-on can only have one trigger of each type, per user, per document" Add-on Restrictions


                If you want to do something like overwrite an Apps Script file, that can be done with the Apps Script API. Even script projects that are bound to a document (Sheets, Forms, Docs) can be overwritten with the Apps Script API.



                StackOverflow answer - Update an Apps Script file using Apps Script



                You can also update the manifest file of an Apps Script file using the Apps Script API, and therefore, programmatically add a library, and the library version to an existing Apps Script File.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 24 '18 at 16:10









                Alan WellsAlan Wells

                20.9k1155100




                20.9k1155100
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53459203%2fgoogle-apps-script-library-and-script-distribution%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Tangent Lines Diagram Along Smooth Curve

                    Yusuf al-Mu'taman ibn Hud

                    Zucchini