Make a P5.js sketch open and run automatically

edited April 2017 in p5.js

I have a display computer running Windows 7 that I've been working on automating so that I don't have to be there in the morning to turn it on. With Processing this is easy, I just made a shortcut and then asked windows to start the shortcut. With P5 I cannot do this. First my P5.js editor must be opened and then my sketch must be loaded and finally it must be played. Can anyone help me autorun a P5.js sketch in Windows 7?

Tagged:

Answers

  • https://www.dwheeler.com/essays/open-files-urls.html

    If you can execute a line, for example by calling a batch file, then you should be able to do this:

    cd c:/go/to/your/folder
    cmd /c start index.html

    where I am assuming index.html is your starting point of your program.

    Kf

  • Thank you

  • edited April 2017 Answer ✓

    If your "index.html" + "sketch.js" files are local, this is my easy lazy recipe: :P

    • Install any Firefox-based browser and make it the default for opening HTML pages.
    • Create a ".bat" file w/ the following content: start "" "folder_path_to_html_file/index.html"
    • Double-click it to check if it's working.
    • Now you can place that in your autorun. \m/
Sign In or Register to comment.