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

#401 2012-05-28 00:14:17

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

Re: Block Files

dreamod wrote:

Well, I meant that other application which would apply the UTI, as an Xcode project.

What I mean is, add this code to the top of the UTI of your copy of Scratch you're editing:

Code:

<key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeDescription</key>
            <string>Block file</string>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
            </array>
            <key>UTTypeIconFile</key>
            <string></string>
            <key>UTTypeIdentifier</key>
            <string>com.dreamod.block</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>block</string>
                </array>
            </dict>
        </dict>
    </array>

Should work, it worked for me.  smile


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

Offline

 

#402 2012-05-28 01:28:18

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

For pc users information: Quick looks are previews of files that can be displayed when pressing space on a file. There are many plugins including audio, images, mp3, text and you can even make your own. But first, you must identify the file. That's what we're doing now.

Offline

 

#403 2012-05-28 01:50:48

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

Re: Block Files

BTW I meant add it into the top of the file you pasted on this post.


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

Offline

 

#404 2012-05-28 09:58:58

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Hardmath123 wrote:

BTW I meant add it into the top of the file you pasted on this post.

ok.

Offline

 

#405 2012-05-28 10:02:35

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

Re: Block Files

If it doesn't work, I'm working on a backup.  smile


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

Offline

 

#406 2012-05-28 10:14:17

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Hardmath123 wrote:

If it doesn't work, I'm working on a backup.  smile

I haven't really got the UTI types to work because I haven't made the other application. So I just need it to have anything to the file? Well, I'll try that.

By the way, thanks for spotting that slip of my name on that block importer project. I censored the others but seemed to have missed that one. Oh and by the way, your first interpretation was correct.

Offline

 

#407 2012-05-28 11:13:24

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

Re: Block Files

dreamod wrote:

Hardmath123 wrote:

If it doesn't work, I'm working on a backup.  smile

I haven't really got the UTI types to work because I haven't made the other application. So I just need it to have anything to the file? Well, I'll try that.

By the way, thanks for spotting that slip of my name on that block importer project. I censored the others but seemed to have missed that one. Oh and by the way, your first interpretation was correct.

Thanks, but I sorta forgot what it was...  tongue  It doesn't matter.  smile  But now I got a new warning to put on the Wiki safety page.

Last edited by Hardmath123 (2012-05-28 11:13:55)


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

Offline

 

#408 2012-05-28 12:41:15

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

So, I made a little application which writes a space to the file and now the file appears blank and the mdls looks like this:
BEFORE:

Code:

kMDItemContentCreationDate     = 2012-05-28 18:37:51 +0200
kMDItemContentModificationDate = 2012-05-28 18:37:51 +0200
kMDItemContentType             = "dyn.ah62d4um4ge80e5dtqrzu"
kMDItemContentTypeTree         = (
    "com.apple.traditional-mac-plain-text",
    "public.plain-text",
    "public.text",
    "public.data",
    "public.item",
    "public.content"
)
kMDItemDisplayName             = "hi.block"
kMDItemFSContentChangeDate     = 2012-05-28 18:37:51 +0200
kMDItemFSCreationDate          = 2012-05-28 18:37:51 +0200
kMDItemFSCreatorCode           = "R*ch"
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "hi.block"
kMDItemFSNodeCount             = 0
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 434
kMDItemFSTypeCode              = "TEXT"
kMDItemKind                    = "Document"
kMDItemLastUsedDate            = 2012-05-28 18:37:51 +0200
kMDItemUsedDates               = (
    "2012-05-28 00:00:00 +0200"
)

AFTER:

Code:

kMDItemContentCreationDate     = 2012-05-28 18:39:05 +0200
kMDItemContentModificationDate = 2012-05-28 18:39:05 +0200
kMDItemContentType             = "dyn.ah62d4rv4ge80e5dtqrzu"
kMDItemContentTypeTree         = (
    "public.data",
    "public.item"
)
kMDItemDisplayName             = "hi.block"
kMDItemFSContentChangeDate     = 2012-05-28 18:39:05 +0200
kMDItemFSCreationDate          = 2012-05-28 18:39:05 +0200
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "hi.block"
kMDItemFSNodeCount             = 0
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 51
kMDItemFSTypeCode              = ""
kMDItemKind                    = "Document"
kMDItemLastUsedDate            = 2012-05-28 18:39:05 +0200
kMDItemUsedDates               = (
    "2012-05-28 00:00:00 +0200"
)

Yes, most of my test names are 'hi'.
I did add the plist thing to the block importer application.

Offline

 

#409 2012-05-28 13:07:41

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

Re: Block Files

Your problem could be that you think writing to a file appends contents: it doesn't. writeToFile replaces the contents completely.

P.S. I got the UTIs working with a single application!  big_smile

Last edited by Hardmath123 (2012-05-28 13:08:03)


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

Offline

 

#410 2012-05-28 13:33:31

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Hardmath123 wrote:

Your problem could be that you think writing to a file appends contents: it doesn't. writeToFile replaces the contents completely.

P.S. I got the UTIs working with a single application!  big_smile

At first I didn't know it doesn't append to the file but it's pretty obvious once tested.
Please elaborate on that last sentence.  smile

Offline

 

#411 2012-05-29 00:08:24

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

Re: Block Files

dreamod wrote:

Hardmath123 wrote:

Your problem could be that you think writing to a file appends contents: it doesn't. writeToFile replaces the contents completely.

P.S. I got the UTIs working with a single application!  big_smile

At first I didn't know it doesn't append to the file but it's pretty obvious once tested.
Please elaborate on that last sentence.  smile

I created an application, which once run assigns the UTI "edu.mit.scratch" to all files ending with ".sb". It only needs to be run once.


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

Offline

 

#412 2012-05-29 01:11:37

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Hardmath123 wrote:

dreamod wrote:

Hardmath123 wrote:

Your problem could be that you think writing to a file appends contents: it doesn't. writeToFile replaces the contents completely.

P.S. I got the UTIs working with a single application!  big_smile

At first I didn't know it doesn't append to the file but it's pretty obvious once tested.
Please elaborate on that last sentence.  smile

I created an application, which once run assigns the UTI "edu.mit.scratch" to all files ending with ".sb". It only needs to be run once.

All right! That sounds great! I have a code which launches the application, but if it's (The Application) absent does nothing. Can you send it with, google docs? How do I find it in google docs?

Offline

 

#413 2012-05-29 01:17:25

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Oh, IT is referring to your  application which adds .sb UTI

Offline

 

#414 2012-05-29 05:26:55

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

Re: Block Files

dreamod wrote:

Hardmath123 wrote:

dreamod wrote:


At first I didn't know it doesn't append to the file but it's pretty obvious once tested.
Please elaborate on that last sentence.  smile

I created an application, which once run assigns the UTI "edu.mit.scratch" to all files ending with ".sb". It only needs to be run once.

All right! That sounds great! I have a code which launches the application, but if it's (The Application) absent does nothing. Can you send it with, google docs? How do I find it in google docs?

I'll post it in a little while. I'll give you a link which takes you to a page where you can download it.  wink

You know what's really annoying though? The QL plugin thing still doesn't recognize it. I guess I need to keep working on it...


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

Offline

 

#415 2012-05-29 10:28:09

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

could you post the xCode project, instead of the application?

Offline

 

#416 2012-05-29 10:52:11

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

Re: Block Files

dreamod wrote:

could you post the xCode project, instead of the application?

It's actually just a plist in a plank app.  tongue  I'll paste the plist here for you.  smile


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

Offline

 

#417 2012-05-29 10:53:49

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Hardmath123 wrote:

dreamod wrote:

could you post the xCode project, instead of the application?

It's actually just a plist in a plank app.  tongue  I'll paste the plist here for you.  smile

do you mean blank app? You said plank app.

Offline

 

#418 2012-05-29 11:11:22

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

Re: Block Files

Oops, sorry.


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

Offline

 

#419 2012-06-02 02:40:54

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Any progress on the UTI type thing you made for Scratch?

Offline

 

#420 2012-06-02 04:22:23

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

Re: Block Files

Nope.  sad  I'm still actively working, though. I'm reverse-engineering Sketch, the sample application which ships with the Dev Docs.


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

Offline

 

#421 2012-06-03 08:05:36

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Well, I ment the application you were referring to when you said "I created an application, which once run assigns the UTI "edu.mit.scratch" to all files ending with ".sb". It only needs to be run once."

Offline

 

#422 2012-06-06 12:01:07

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Can I have the plist?

Offline

 

#423 2012-06-13 10:22:11

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

Re: Block Files

Code:

    <key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeDescription</key>
            <string>Scratch project file</string>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
            </array>
            <key>UTTypeIconFile</key>
            <string></string>
            <key>UTTypeIdentifier</key>
            <string>edu.mit.scratch</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>sb</string>
                </array>
            </dict>
        </dict>
    </array>

This UTI-exports ".sb" as "edu.mit.scratch". Try and incorporate this into the block exporter/importer.  smile  (Note: Before releasing a UTI-exporter like this, it's a good idea to double-check with the Scratch Team, since assigning edu.mit.scratch could hold the ST responsible for anything that goes wrong.)


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

Offline

 

#424 2012-06-13 12:17:28

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

Hardmath123 wrote:

(property list)
This UTI-exports ".sb" as "edu.mit.scratch". Try and incorporate this into the block exporter/importer.  smile  (Note: Before releasing a UTI-exporter like this, it's a good idea to double-check with the Scratch Team, since assigning edu.mit.scratch could hold the ST responsible for anything that goes wrong.)

Don't worry i'll change all the strings. thanks.  big_smile

Offline

 

#425 2012-06-13 12:21:57

dreamod
New Scratcher
Registered: 2012-01-22
Posts: 100+

Re: Block Files

here's my result: http://www.freeimagehosting.net/lgngi

Offline

 

Board footer