mattdesl / canvas-sketch

[beta] A framework for making generative artwork in JavaScript and the browser.
MIT License
5.02k stars 393 forks source link

Error exporting frames CMD + S #173

Open giodum opened 1 year ago

giodum commented 1 year ago

Hi everybody, I am trying for the first time canvas-sketch, but I am facing a problem. Pressing cmd + S or ctrl + S an image should be saved, but the only thing that I get is a re-run of the code and nothing get saved.

I installed everything via npm, and these are my versions: "canvas-sketch": "^0.7.6", "canvas-sketch-cli": "^1.11.20"

I tried to export images in Chrome, Safari and Firefox, but I always get the same result.

Thank you in advance

Giorgio

raphaelrockus commented 1 year ago

Hi Giorgio,

I think what's happening is that you are sending the keys "Cmd + S" or "Ctrl + S" to your code editor (thus triggering the saving of your code and the hot reload) while you need to send them towards the browser instead.

You can use "Alt-tab" or "Cmd + tab" to alternate between open windows or just click on your browser and then type the keys.

Let me know if it helped.

Cheers from Belgium, Raphaël

sixrumcoins commented 1 year ago

Hi Raphael,

I have the same issue — pressing Cmd + S / Ctrl + S:

Not sure it's related to "sending the keys to your code editor" — I don't see my editor uses these combinations to trigger anything related to re-run/refresh.

canvas-sketch-cli@1.11.20 canvas-sketch-util@1.10.0 any browser

I'd appreciate if you can advise a solution.

Kind regards, S


UPDATE Saving does not trigger re-run if using "tick" as described here https://github.com/mattdesl/canvas-sketch/issues/25

SebdGv commented 8 months ago

hi everyone,

same issue - Has anyone found a solution to fix it?

Thank you

dudesl commented 5 months ago

Hi Giorgio,

I think what's happening is that you are sending the keys "Cmd + S" or "Ctrl + S" to your code editor (thus triggering the saving of your code and the hot reload) while you need to send them towards the browser instead.

You can use "Alt-tab" or "Cmd + tab" to alternate between open windows or just click on your browser and then type the keys.

Let me know if it helped.

Cheers from Belgium, Raphaël

This is a great hint! the Cmd-s / Ctrl-s should be pressed ON the browser, not in the editor