Skip to main content
jchichignoud
Known Participant
October 25, 2017
Answered

Script running twice the first time

  • October 25, 2017
  • 1 reply
  • 450 views

Hello,

I'm very new to developing HTML5 extensions, and coding in general, so forgive me if the question is basic or if I'm not sharing the right information to help solve my issue.

I wrote a simple panel with a single button firing a script to duplicate, rename (by incrementing the version number) and archive and active sequence.

All seems to work well, except that the first time I use it, it seems to be running twice in a row. Every time after that it seems to run fine.

Here's the GitHub link to my script: adobe-premiere-handy-tools/hostscript.jsx at master · jchichignoud/adobe-premiere-handy-tools · GitHub

I used the skeleton extension that comes with Brackets to build it, so I didn't really do anything else than change the name of the button outside of the hostscript.jsx

Thanks in advance for your help.

This topic has been closed for replies.
Correct answer Bruce Bullis

At first glance it appears that, in /jsx/hostscript.jsx line 12, you're calling duplicateActive(), whenever hostscript.jsx is loaded.

That seems...odd.

Tell me more about the workflow(s) you'd like to support, and I can provide better/more specific guidance.

1 reply

Bruce Bullis
Bruce BullisCorrect answer
Legend
October 25, 2017

At first glance it appears that, in /jsx/hostscript.jsx line 12, you're calling duplicateActive(), whenever hostscript.jsx is loaded.

That seems...odd.

Tell me more about the workflow(s) you'd like to support, and I can provide better/more specific guidance.

jchichignoud
Known Participant
October 25, 2017

Ah yes... Thanks Bruce. That's the issue. I'm still wrapping my head around how it works, and I when I first wrote the script I used JSX Launcher to test and debug, and for that I needed the .jsx itself to call the function. I forgot to remove it once I added the script to the extension package. Makes sense.

Sorry for the basic question and thanks so much for the quick reply!