This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-04-03 20:24:54

dnatrixene135
New Scratcher
Registered: 2011-03-30
Posts: 2

Scratch command line parameters

My friend and I are making a project that uses scratch through a batch file.
What are all the parameters we can use for scratch.exe?

Offline

 

#2 2011-04-03 20:44:40

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Scratch command line parameters

This looks to be more of an advanced topic than All About Scratch topic. I'll move it to the appropriate forum for you.  smile

Offline

 

#3 2011-04-04 11:18:34

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch command line parameters

All of the command line parameters Scratch looks for are found below (I know because I checked the source).

- "presentation" makes scratch go into presentation mode
- "fullscreen" makes scratch go into fullscreen
- "filename" makes scratch open the file (if it's an .sb file)

Of course, if you're attaching the Scratch EXE along with the batch file, you can modify Scratch to accept more command-line arguments.

To do this, open Scratch's IDE using the Shift-Click-R method and navigating using the browser to:
Scratch-UI-Panes -> ScratchFrameMorph -> startup -> startup
There you will find (about half way down) the code that uses the command line args.

Hope it helped!

Offline

 

#4 2011-04-05 01:16:06

dnatrixene135
New Scratcher
Registered: 2011-03-30
Posts: 2

Re: Scratch command line parameters

I'm not quite sure how the syntax goes. When I try to open it in cmd.exe, it doesn't work.
I type in

Code:

C:\Program Files\Scratch>scratch -presentation

and what happens is a normal scratch window opens with the default scratch cat.

Say I have "project.sb" saved in the same directory as the Scratch installation (C:\Program Files\Scratch\). If I use the command prompt, how will I be able to open it up in presentation mode, and so on? What are the other things I can get it to do like this?

Offline

 

#5 2011-04-05 10:16:48

ihaveamac
Scratcher
Registered: 2007-09-22
Posts: 1000+

Re: Scratch command line parameters

dnatrixene135 wrote:

I'm not quite sure how the syntax goes. When I try to open it in cmd.exe, it doesn't work.
I type in

Code:

C:\Program Files\Scratch>scratch -presentation

and what happens is a normal scratch window opens with the default scratch cat.

Say I have "project.sb" saved in the same directory as the Scratch installation (C:\Program Files\Scratch\). If I use the command prompt, how will I be able to open it up in presentation mode, and so on? What are the other things I can get it to do like this?

With Scratch you do not type "-presentation", you actually type "presentation" without the quotes and the dash.


~ihaveamac - visit ihaveamac.net

Offline

 

#6 2012-07-29 18:23:13

annoyingorange64
Scratcher
Registered: 2011-07-31
Posts: 1

Re: Scratch command line parameters

@echo off
start C:\Program Files\Scratch.exe

Last edited by annoyingorange64 (2012-07-29 18:26:18)

Offline

 

Board footer