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:
<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.
Offline
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
BTW I meant add it into the top of the file you pasted on this post.
Offline
If it doesn't work, I'm working on a backup.
Offline
Hardmath123 wrote:
If it doesn't work, I'm working on a backup.
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
dreamod wrote:
Hardmath123 wrote:
If it doesn't work, I'm working on a backup.
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... It doesn't matter. But now I got a new warning to put on the Wiki safety page.
Last edited by Hardmath123 (2012-05-28 11:13:55)
Offline
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:
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:
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
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!
Last edited by Hardmath123 (2012-05-28 13:08:03)
Offline
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!
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.
Offline
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!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.
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
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!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.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
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.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.
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...
Offline
dreamod wrote:
could you post the xCode project, instead of the application?
It's actually just a plist in a plank app. I'll paste the plist here for you.
Offline
Oops, sorry.
Offline
Nope. I'm still actively working, though. I'm reverse-engineering Sketch, the sample application which ships with the Dev Docs.
Offline
<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. (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.)
Offline
Hardmath123 wrote:
(property list)
This UTI-exports ".sb" as "edu.mit.scratch". Try and incorporate this into the block exporter/importer. (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.
Offline