1 Reply Latest reply on Aug 10, 2017 3:42 PM by Peter Kahrel

    What does #include do?

    jakec88782761 Level 2

      Hi everyone,

       

      This is a general questions about #include.

       

      I wrote a very long script (around 2000 lines) that imports idml files that have been translated, creates new paragraph styles based on the language, searches the text for keywords and adds hyperlinks to them. Although it worked, it was temperamental. Sometimes it would error, sometimes it just wouldn't create the hyperlinks, and other times it just told me that objects were invalid.

       

      So, since the script was made up of individual functions that each had a small task, I separated them into their own .jsx file and included them in one main file using #include. Then, I just called them one by one.

      Now, it works every time, no errors.

       

      I'm wondering, is there something 'under the hood' that I should know about #include?

       

      If anyone can shed some light on this, I'd appreciate it

       

      Jake