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

#1 2011-10-16 07:29:53

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Scratch Project to Mac Application in 3 easy steps!

Converting Scratch Projects to Mac OS X Applications
Assuming you have reasonable knowledge of Xcode and Interface Builder. If you don't, I'll try to clarify the details.
Create a Mac Application called iScratchProj
Here are your codes:
Classes:
iScratchProjAppDelegate.h

Code:

// Import Cocoa framework
#import <Cocoa/Cocoa.h>
// Import WebKit framework
#import <WebKit/WebKit.h>

@interface iBlobAppDelegate : NSObject <NSApplicationDelegate> {
    // Create the window
    NSWindow *window;
    
    // Get the applet
    IBOutlet id webView;
}
// Get the window
@property (assign) IBOutlet NSWindow *window;

@end

iScratchProjAppDelegate.m

Code:

#import "iBlobAppDelegate.h"

@implementation iBlobAppDelegate

@synthesize window;

// When the application loaded...
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Add the applet to the screen
    [webView stringByEvaluatingJavaScriptFromString:@"document.write(\"<#Paste here#>\")"];
}

@end

Note: once you paste, you will get a floating oval in your code. Delete it like a character, and replace it with the Embed code of your project (open the project on the website, click Embed (under tags), and copy the second text). Then replace style='display:block;' with style='position:absolute;left:0;top:-25;'.
Interfaces:
MainMenu.xib/nib
Add a UIWebView to the window. Set the size to 482x362. Control-click from the blue cube (in the "MainMenu.xib - English" window) and drag it to the webview. In the popup black HUD window, click on the only choice (webView).

Once you have saved all three files, build and run. Ta-Da!

Last edited by Hardmath123 (2011-10-16 07:31:07)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#2 2011-10-16 08:59:09

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

If only there were a way to make one for pc...

Does this make it an application but you can still edit it? Or does it force presentation mode?

Last edited by Pecola1 (2011-10-16 09:00:18)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#3 2011-10-16 09:05:44

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: Scratch Project to Mac Application in 3 easy steps!

I'll make sure to try this on my mac in a bit.  smile


http://i.imgur.com/zeIZW.png

Offline

 

#4 2011-10-16 09:35:07

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

Pecola1 wrote:

If only there were a way to make one for pc...

Does this make it an application but you can still edit it? Or does it force presentation mode?

Did you really just type that? *facepalm*

There are dozens of ways to make Scratch a “.exe” file, and as of now, there are only two ways to make it a “.app” file. And one of them’s downloader is broken.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#5 2011-10-25 06:31:28

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

Bump.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#6 2011-10-25 10:38:26

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

Very interesting.  smile
Unfortunately, I do not have a Mac. :OOOOO

Offline

 

#7 2011-10-25 11:18:59

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

ProgrammingFreak wrote:

Very interesting.  smile
Unfortunately, I do not have a Mac. :OOOOO

I'm not sure, but I think if you have Google Chrome and VB studio on Windows, you can replicate this with WebKit Chrome. No guarantees, though. Apple has much cooler apis.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#8 2011-10-25 13:40:53

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

Hardmath123 wrote:

ProgrammingFreak wrote:

Very interesting.  smile
Unfortunately, I do not have a Mac. :OOOOO

I'm not sure, but I think if you have Google Chrome and VB studio on Windows, you can replicate this with WebKit Chrome. No guarantees, though. Apple has much cooler apis.

I don't have the full studio.  hmm

Offline

 

#9 2011-10-29 10:22:04

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

Hardmath123 wrote:

Bump.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#10 2012-02-08 12:20:43

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

will this work for panther?


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#11 2012-02-08 12:25:39

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

no it doesn't seem like it  sad


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#12 2012-02-08 16:28:13

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

How does this work. (besides WebKIt...)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#13 2012-02-09 10:43:54

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

All it does is creates a tiny web browser window and opens the project on the Scratch site. Then it uses a bit of JavaScript to position the project in the window and hide scroll bars, so it looks like it's just the project.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#14 2012-02-09 16:09:49

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

That makes a lot more sense.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#15 2012-02-09 22:08:10

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

ProgrammingFreak wrote:

Hardmath123 wrote:

ProgrammingFreak wrote:

Very interesting.  smile
Unfortunately, I do not have a Mac. :OOOOO

I'm not sure, but I think if you have Google Chrome and VB studio on Windows, you can replicate this with WebKit Chrome. No guarantees, though. Apple has much cooler apis.

I don't have the full studio.  hmm

I bought proffesional. It was worth it, but express works the same.


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#16 2012-02-12 20:18:32

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#17 2012-04-02 16:40:53

pipercubjl
Scratcher
Registered: 2010-05-20
Posts: 73

Re: Scratch Project to Mac Application in 3 easy steps!

Hello all!

smile

I export scratch games as .app's using BYOB. It works great. If you want to change the icon follow these easy instructions:

Right click on the .app file.
Then select "Show package contents."
Open the folder called "Contents"
Open the folder called "Resources"
Replace "BYOBApp.icns" with the icon you want


Tip's
––––––
-Make sure you replace the icon with a .icns file

-Make sure you call it "BYOBApp"


http://scratch.mit.edu/static/projects/pipercubjl/2621398_med.png  http://scratch.mit.edu/static/projects/pipercubjl/2634368_med.png
        Crypt            Pixel Lands

Offline

 

#18 2012-04-12 02:37:20

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Scratch Project to Mac Application in 3 easy steps!

Hardmath123 wrote:

ProgrammingFreak wrote:

Very interesting.  smile
Unfortunately, I do not have a Mac. :OOOOO

I'm not sure, but I think if you have Google Chrome and VB studio on Windows, you can replicate this with WebKit Chrome. No guarantees, though. Apple has much cooler apis.

I have Visual Studio 2010 Ultimate (it's great when the help desk at school has awesome software that you can install for free) + Google Chrome + Windows 7.  So I guess I could test this out...

EDIT: On second thought, I don't know a thing about XCode.  The code you have typed there looks like Objective-C, but I can't be sure.  I'm pretty sure the @interface syntax is unique to Obj-C...

Last edited by amcerbu (2012-04-12 02:42:00)

Offline

 

#19 2012-07-11 13:36:22

lemonpretzel
Scratcher
Registered: 2008-10-23
Posts: 100+

Re: Scratch Project to Mac Application in 3 easy steps!

Won't this only work if you have an internet connection, and only after you upload your project online?

Offline

 

#20 2012-07-11 21:03:01

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

Yes.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#21 2012-07-11 21:03:59

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Scratch Project to Mac Application in 3 easy steps!

Looks cool! I'll try it!


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

Board footer