sparks wrote:
It's been a lot bugger than you thought, huh?
I thought that's what always happens when making such things...
Offline
G0D_M0D3 wrote:
This. Is. Awesome.
I still love manually doing this, though. I learned more about coding that way, and I even made a few blocks for the now inactive (I think?) block library, but under a different name.
Thank you. I have worked a lot on this, and I appreciate your opinions. I love squeak and I definitely think you should explore squeak but sometimes you're not really in the mood for finding the control or motion section in the block spec array, am I right? That's a good reason to use my block importer.
Offline
sparks wrote:
Yeah, you're doing an amazing job!
I meant "buggier" by the way, sorry for the accidental mild language
Yes, I understood that you meant 'buggier', but that didn't concern me too much. I too, make mistakes. Now, I'm just excited about the block uploader, once the site gets finished.
Offline
Wow! I just saw that you updated the version file, dreamod! There's a lot of code there. Is the idea, then, that it checks the first line to work out whether it's a new version, then uses the rest of the code to actually update itself? Looks pretty neat!
Offline
Hi dreamod,
I do in fact use Xcode a lot, and believe it or not, I have actually tried to build a QuickLook plugin for Scratch! The problem was with UTI's. You see, every Mac app (and I think other platforms, but I'm not sure) has a unique UTI (Uniform Type Identifier) which identifies the creator of an application. For example Scratch has the UTI edu.mit.Scratch. My plugin was not identifying the Scratch UTI, which is why I think this could be problematic. If you, however, create a Mac application which generated Block files, with it's own UTI, I might be able to help. It might be as simple as an application which has a textarea for the code, and allows you to save and modify it. In fact, with this technology, block files can have custom file icons, not to mention all sorts of other goodies. I know a very good amount of Objective-C, Cocoa, and Quartz (the three powerful technologies you smash together in a QLp). I'll look into it again, anyway. The actual image rendering should be extremely easy.
Good luck,
Hardmath
Offline
sparks wrote:
Wow! I just saw that you updated the version file, dreamod! There's a lot of code there. Is the idea, then, that it checks the first line to work out whether it's a new version, then uses the rest of the code to actually update itself? Looks pretty neat!
Yes, first it reads the first line, and then it tells the user that it has successfully connected to the website, then when pressing yes (when prompted to proceed) it files-in all but the first line, which includes a method that reports a constant, which is going to be called to refer to the current version.
Offline
Hardmath123 wrote:
Hi dreamod,
I do in fact use Xcode a lot, and believe it or not, I have actually tried to build a QuickLook plugin for Scratch! The problem was with UTI's. You see, every Mac app (and I think other platforms, but I'm not sure) has a unique UTI (Uniform Type Identifier) which identifies the creator of an application. For example Scratch has the UTI edu.mit.Scratch. My plugin was not identifying the Scratch UTI, which is why I think this could be problematic. If you, however, create a Mac application which generated Block files, with it's own UTI, I might be able to help. It might be as simple as an application which has a textarea for the code, and allows you to save and modify it. In fact, with this technology, block files can have custom file icons, not to mention all sorts of other goodies. I know a very good amount of Objective-C, Cocoa, and Quartz (the three powerful technologies you smash together in a QLp). I'll look into it again, anyway. The actual image rendering should be extremely easy.
Good luck,
Hardmath
Thanks, I love Objective-C and I've started using it in Xcode a while ago (I made currency converter and a few others). I have a copy of the scratch VM in which I edited the plist with Property List Editor and added and replaced a few icons. It is set to have a certain icon for block files but however, they show up as a text document would, except showing 'BLOCK' on top. Do you know why this happens? I added this code to the plist under "document types"
... <dict> <key>CFBundleTypeExtensions</key> <array> <string>block</string> </array> <key>CFBundleTypeIconFile</key> <string>BlockFiles.icns</string> <key>CFBundleTypeName</key> <string>Scratch Block File</string> <key>CFBundleTypeOSTypes</key> <array> <string>STam</string> </array> <key>CFBundleTypeRole</key> <string>Editor</string> </dict> ...
Also, I changed the Bundle identifier to com.dreamod.blockImporter, was that foolish?
The Bundle version is still '3.8.14b7y'.
The Block Importer Application runs the 'block importer.image' file and the image file creates and saves block files. Does that count?
Offline
dreamod wrote:
Hardmath123 wrote:
Hi dreamod,
I do in fact use Xcode a lot, and believe it or not, I have actually tried to build a QuickLook plugin for Scratch! The problem was with UTI's. You see, every Mac app (and I think other platforms, but I'm not sure) has a unique UTI (Uniform Type Identifier) which identifies the creator of an application. For example Scratch has the UTI edu.mit.Scratch. My plugin was not identifying the Scratch UTI, which is why I think this could be problematic. If you, however, create a Mac application which generated Block files, with it's own UTI, I might be able to help. It might be as simple as an application which has a textarea for the code, and allows you to save and modify it. In fact, with this technology, block files can have custom file icons, not to mention all sorts of other goodies. I know a very good amount of Objective-C, Cocoa, and Quartz (the three powerful technologies you smash together in a QLp). I'll look into it again, anyway. The actual image rendering should be extremely easy.
Good luck,
HardmathThanks, I love Objective-C and I've started using it in Xcode a while ago (I made currency converter and a few others). I have a copy of the scratch VM in which I edited the plist with Property List Editor and added and replaced a few icons. It is set to have a certain icon for block files but however, they show up as a text document would, except showing 'BLOCK' on top. Do you know why this happens? I added this code to the plist under "document types"
Code:
... <dict> <key>CFBundleTypeExtensions</key> <array> <string>block</string> </array> <key>CFBundleTypeIconFile</key> <string>BlockFiles.icns</string> <key>CFBundleTypeName</key> <string>Scratch Block File</string> <key>CFBundleTypeOSTypes</key> <array> <string>STam</string> </array> <key>CFBundleTypeRole</key> <string>Editor</string> </dict> ...Also, I changed the Bundle identifier to com.dreamod.blockImporter, was that foolish?
The Bundle version is still '3.8.14b7y'.
The Block Importer Application runs the 'block importer.image' file and the image file creates and saves block files. Does that count?
Hmmm, no idea. I'm not sure you should edit the plist of Scratch, because the inner workings of Scratch file saving might be causing problems. It seems more reasonable to create your own application, maybe MacBlock or something.
Offline
Hardmath123 wrote:
dreamod wrote:
Hardmath123 wrote:
Hi dreamod,
I do in fact use Xcode a lot, and believe it or not, I have actually tried to build a QuickLook plugin for Scratch! The problem was with UTI's. You see, every Mac app (and I think other platforms, but I'm not sure) has a unique UTI (Uniform Type Identifier) which identifies the creator of an application. For example Scratch has the UTI edu.mit.Scratch. My plugin was not identifying the Scratch UTI, which is why I think this could be problematic. If you, however, create a Mac application which generated Block files, with it's own UTI, I might be able to help. It might be as simple as an application which has a textarea for the code, and allows you to save and modify it. In fact, with this technology, block files can have custom file icons, not to mention all sorts of other goodies. I know a very good amount of Objective-C, Cocoa, and Quartz (the three powerful technologies you smash together in a QLp). I'll look into it again, anyway. The actual image rendering should be extremely easy.
Good luck,
HardmathThanks, I love Objective-C and I've started using it in Xcode a while ago (I made currency converter and a few others). I have a copy of the scratch VM in which I edited the plist with Property List Editor and added and replaced a few icons. It is set to have a certain icon for block files but however, they show up as a text document would, except showing 'BLOCK' on top. Do you know why this happens? I added this code to the plist under "document types"
Code:
... <dict> <key>CFBundleTypeExtensions</key> <array> <string>block</string> </array> <key>CFBundleTypeIconFile</key> <string>BlockFiles.icns</string> <key>CFBundleTypeName</key> <string>Scratch Block File</string> <key>CFBundleTypeOSTypes</key> <array> <string>STam</string> </array> <key>CFBundleTypeRole</key> <string>Editor</string> </dict> ...Also, I changed the Bundle identifier to com.dreamod.blockImporter, was that foolish?
The Bundle version is still '3.8.14b7y'.
The Block Importer Application runs the 'block importer.image' file and the image file creates and saves block files. Does that count?Hmmm, no idea. I'm not sure you should edit the plist of Scratch, because the inner workings of Scratch file saving might be causing problems. It seems more reasonable to create your own application, maybe MacBlock or something.
I copied the Scratch VM and then I edited the 'info.plist' in contents. Everything works fine if not better and in the menu bar it says Block Importer instead of Scratch as it does in some other mods where they just change the name of the application. I haven't noticed any differences except for the name changes I made. I'm going to post a link soon, I would be good if you took a look at that.
Offline
dreamod wrote:
Hardmath123 wrote:
dreamod wrote:
Thanks, I love Objective-C and I've started using it in Xcode a while ago (I made currency converter and a few others). I have a copy of the scratch VM in which I edited the plist with Property List Editor and added and replaced a few icons. It is set to have a certain icon for block files but however, they show up as a text document would, except showing 'BLOCK' on top. Do you know why this happens? I added this code to the plist under "document types"Code:
... <dict> <key>CFBundleTypeExtensions</key> <array> <string>block</string> </array> <key>CFBundleTypeIconFile</key> <string>BlockFiles.icns</string> <key>CFBundleTypeName</key> <string>Scratch Block File</string> <key>CFBundleTypeOSTypes</key> <array> <string>STam</string> </array> <key>CFBundleTypeRole</key> <string>Editor</string> </dict> ...Also, I changed the Bundle identifier to com.dreamod.blockImporter, was that foolish?
The Bundle version is still '3.8.14b7y'.
The Block Importer Application runs the 'block importer.image' file and the image file creates and saves block files. Does that count?Hmmm, no idea. I'm not sure you should edit the plist of Scratch, because the inner workings of Scratch file saving might be causing problems. It seems more reasonable to create your own application, maybe MacBlock or something.
I copied the Scratch VM and then I edited the 'info.plist' in contents. Everything works fine if not better and in the menu bar it says Block Importer instead of Scratch as it does in some other mods where they just change the name of the application. I haven't noticed any differences except for the name changes I made. I'm going to post a link soon, I would be good if you took a look at that.
Here's something to try: create a file with the "mod", then use Terminal to run this code
mdls filename
(where filename is the path to the file, like ~/Desktop/blah.block)
Copy and paste what happens, please. That will help check how the UTI-sharing worked. See, you need to formally "export" every custom UTI you make, which I'm not sure is happening.
Offline
Ok.
kMDItemContentCreationDate = 2012-05-07 17:22:40 +0200 kMDItemContentModificationDate = 2012-05-07 17:22:40 +0200 kMDItemContentType = "dyn.ah62d4um4ge80e5dtqrzu" kMDItemContentTypeTree = ( "com.apple.traditional-mac-plain-text", "public.plain-text", "public.text", "public.data", "public.item", "public.content" ) kMDItemDisplayName = "move () steps.block" kMDItemFSContentChangeDate = 2012-05-07 17:22:40 +0200 kMDItemFSCreationDate = 2012-05-07 17:22:40 +0200 kMDItemFSCreatorCode = "R*ch" kMDItemFSFinderFlags = 0 kMDItemFSHasCustomIcon = 0 kMDItemFSInvisible = 0 kMDItemFSIsExtensionHidden = 0 kMDItemFSIsStationery = 0 kMDItemFSLabel = 0 kMDItemFSName = "move () steps.block" kMDItemFSNodeCount = 0 kMDItemFSOwnerGroupID = 20 kMDItemFSOwnerUserID = 501 kMDItemFSSize = 10696 kMDItemFSTypeCode = "TEXT" kMDItemKind = "Scratch Block File" kMDItemLastUsedDate = 2012-05-07 17:22:40 +0200 kMDItemUsedDates = ( "2012-05-07 00:00:00 +0200" )
Offline
Ah, ok, so you're not creating your own UTI (it would show up in front of kMSItemContentType). "dyn" codes are generic for unrecognized UTI's. To get a custom UTI working, you need to export it.
P.S. I'm glad you blanked out your name, I just realized this morning the code has your username and felt a bit bad about making you post it...
EDIT: Exporting URI's: Apple reference
Last edited by Hardmath123 (2012-05-08 09:27:43)
Offline
Hardmath123 wrote:
Ah, ok, so you're not creating your own UTI (it would show up in front of kMSItemContentType). "dyn" codes are generic for unrecognized UTI's. To get a custom UTI working, you need to export it.
P.S. I'm glad you blanked out your name, I just realized this morning the code has your username and felt a bit bad about making you post it...
EDIT: Exporting URI's: Apple reference
Ok, that's good to know, I hope I get somewhere with this. My Mac certainly does treat it as a plain text file.
Thanks for the link, I'll read it and try to see if I can make a new UTI type.
P.S.
I am VERY careful about personal information, and I know how to censor. I wouldn't even tell you that I'm a guy... whoops, well, you get the point.
Offline
sparks wrote:
If you need more than one hosted text file, just let me know, btw
Thanks, you are very nice. I would like to help you too, so I have an idea for the block library website that I would like to share. I animated a picture to show how the website might look. Please take a look at this: http://s11.postimage.org/3ofogtew1/Idea_For_Block_Library_Website.png
As seen on the third 'draggable?' block, when one of those areas gets clicked, then it should expand and show more detail including a download link. At the bottom you would have blocks to mark pages. Of course, I do not expect you to get this done anytime soon but I think you should consider this layout. The blocks would be replaced by other ones. I didn't feel like creating a bunch of new blocks, export them, and copy them into the picture so I just copied the two top blocks.
Offline
dreamod wrote:
I animated a picture to show how the website might look. Please take a look at this: http://s11.postimage.org/3ofogtew1/Idea_For_Block_Library_Website.png
As seen on the third 'draggable?' block, when one of those areas gets clicked, then it should expand and show more detail including a download link. At the bottom you would have blocks to mark pages.
Looks nice. I'd suggest not having the different coloured page numbers -- makes them look like different block categories at first glance. Cool idea, though!
Offline
blob8108 wrote:
dreamod wrote:
I animated a picture to show how the website might look. Please take a look at this: http://s11.postimage.org/3ofogtew1/Idea_For_Block_Library_Website.png
As seen on the third 'draggable?' block, when one of those areas gets clicked, then it should expand and show more detail including a download link. At the bottom you would have blocks to mark pages.Looks nice. I'd suggest not having the different coloured page numbers -- makes them look like different block categories at first glance. Cool idea, though!
Ok, I guess I could agree with you on that one.
Offline
Wow! I had a look, it's a very good layout idea! I like the expanding idea, since it will keep things nice and tidy. Something I was considering was a download count and love-it system for the blocks too, what do people think?
Offline
sparks wrote:
Wow! I had a look, it's a very good layout idea! I like the expanding idea, since it will keep things nice and tidy. Something I was considering was a download count and love-it system for the blocks too, what do people think?
Actually, it never crossed my mind to have a love-it or download count feature. That sounds good though, and I can't wait to see the finished block library website. The download section might confuse people if you don't have some sort of tab for the block importer, I'll give you permission to use it. Actually, I'd be honored if you had it on your site.
Offline
I would like to make it so that if you drag a block into the block editor dialog you insert 'self ' , (aMorph selector copyReplaceAll: ':' with: ': ()'), I edited the acceptDroppingMorph: aMorph event: evt method but it seems that that blocks treat the dialog as if it were the World, can somebody help me make blocks embed into DialogBoxMorphs?
Offline
Dreamod, I'm starting work on the block sharing page on the block library! It would be great if you could post a sample code for a stack block with the spec "block name", the code "block code" and soforth so that I can get the form to output a complete block file, ready for importing!
Offline
sparks wrote:
Dreamod, I'm starting work on the block sharing page on the block library! It would be great if you could post a sample code for a stack block with the spec "block name", the code "block code" and soforth so that I can get the form to output a complete block file, ready for importing!
Could we fix the problem where you can upload blocks for categories that don't exist in that mod? (i.e., a Files block for Scratch)
Offline