I'd like to write a function to read archived emails from TheBat mail client archive file (.tbk). However, I can't find any specification of the format.
If anyone has this format description or digged it themselves, I'd be grateful.
Check out TheBat API Docs. Even if they don't give you direct low-level format of the file, using them you should be able to write your own functions to read message storage.
Try to open the tbk file in a text editor (notepad++ on windows, vi(m) or nano on linux, I don t know what on mac).
Is it plain text?
Yes->Write your parser
No->Write your parser using the API
Related
So I have scoured google for mention of anybody trying to use powershell to get information about files from a URL/URI but with no luck. I have found ways to get metadata of files from a local source but nothing for an image hosted on a website.
What I want to do:
I have a list of image URL's eg. www.website/images/img.jpg and want to grab the metadata without having to download the entire image. I would then store and export this info to a csv to look over later.
So far my code has been resigned to System.Net.Webclient.DownloadFile() and then operating on them locally. Is it possible to do this remotely?
I suppose you're referring to EXIF metadata. Those are embedded in the file, so unless the remote host provides an API that exposes this information you must download the file to be able to read the information.
Judging from what I gleaned from the standard the information is stored at the beginning of the file, so you could try to download just the first couple hundred bytes. However, the size of the EXIF header doesn't seem to be fixed, so you'll want to retrieve a large enough chunk. Also, standard EXIF parsers might not work on incomplete images, so you might need to write your own parser.
All in all I'd say downloading the entire file and extracting the information with standard tools is your best option.
Unfortunately I have lost my .tex file, and I have changed a lot of things in my resume. I was wondering if there might be a way to convert a PDF file created with Kile and LaTeX back into a .tex file? I am using OSX Mavericks, so any tool will be really appreciated. I did a quick survey on web and saw some comments that it's not possible. Hopefully there's a way in my special case.
Sorry but I think it's never possible to convert a PDF back to it's sources...
Try opening the file with Lyx. As it is a WYSIWYG processor it may work.
How can I edit info.plist file of xcode project? I have tried searching a lot but nothing specific.
An info.plist file can be considered 2 ways. One, it's just a specially formatted text file so thinking that way you can manipulate the text directly. Applescript can read text files, manipulate text, and write text files. Two, it's a basic xml file formatted with apple's tags to create a "plist" file. So you could use xml tools on the file as well. System Events has xml tools. There's also a unix command line program called "defaults" that can work on them as well.
So there's several tools. You need to think about what you want to do, how complicated the task is, and then decide which tool will best fit your requirements.
After you figure out those basics, try some things and come back and ask specific questions.
Looking at https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSAttributedString_AppKitAdditions/Reference/Reference.html, there are quite a few document formats that AppKit makes it easy to export to, including even MS Word. It seems strange that Apple wouldn't also provide easy export functionality like this for their own word processing software.
Am I missing something in the documentation? Or should this be done using some other set of tools? I know I could export to pretty much any of those other formats and Pages would import it, but it would be nice to export directly to that format.
Alternatively, if there's a specification out there that would help in developing an export method like the ones above, that would also be useful.
Or should I be looking into AppleScript hooks to do this sort of thing?
No, you are not missing anything. There is no API to programmatically create Pages files and no public spec for the format. Unless there is specific reason you need Pages files, your best bet is to create RTF files. You can write code to create formatted RTF files, and Pages will open them and you'll see the correct formatting.
My windows co-workers were asking me if I could modify my non-windows binary files such that when their "Properties" are examined under Windows, they could see a "Version" tab like that which would show for a Visual Studio compiled exe.
Specifically, I have some gzipped binary files and was wondering if I could modify them to satisfy this demand. If there's a better way, that would be fine, too.
Is there a way I could make my binaries appear to be exe files?
I tried simply appending the VS_VERSION_INFO block from notepad.exe to the end of one of my binaries in the hope that Windows scans for the block, but it didn't work.
I tried editing the other information regarding Author, Subject, Revision, etc. That doesn't modify the file, it just creates another data fork(what's the windows term?) for the file in NTFS.
It is not supported by windows, since each file type has their own file format. But that doesn't mean you can't accomplish it. The resources stored inside dlls and exes are part of the file format.
Display to the user:
If you wanted this information to be displayed to the user, this would probably be best accomplished with using a property page shell extension. You would create a similar looking page, but it wouldn't be using the exact same page. There is a really good multi part tutorial on shell extensions, including property pages starting with that link.
Where to actually store the resource:
Instead of appending a block to the file, you could store the resource into a separate alternate data stream on the same file. This would leave the original file stream non corrupted on disk and not cause its primary file size to change.
Alternate data streams allow more than one data stream to be associated with a filename. Each stream is identified by a colon : at the end of the filename and an identifier.
You can create them for example by doing:
notepad test.txt:adsname1
notepad test.txt:adsname2
notepad test.txt
Getting the normal Win32 APIs working:
If you wanted the normal API to work, you'd have to intercept the Win32 APIs: LoadLibraryEx, FindResource, LoadResource and LockResource. This is probably not worth the trouble though since you are already creating your own property page.
Can't think of any way to do this short of a shell extension. The approach I've taken in the past is a separate "census" program that knows how to read version information from any kind of file.
Zip files can be converted into exe files by using a program that turns a zip file into a self-extracting zip (I know that WinZip does this, there are most likely free utilities for this also; here's one that came up on a search but I haven't actually tried it). Once you've got an exe, you should be able to use a tool like Resource Hacker to change the version information.
It won't work. Either Windows would have to know every file format or no file format would be disturbed if version information were appended to it.
No, resource section is only expected inside PE (portable executable; exe, dll, sys).
It is more then just putting the data inside the file, you have a table that points to the data in the file header.
What you can do if you have NTFS drive, is to use NTFS stream to store custom properties this way the contact of the binary file will remain the same, but you will need to use a custom shell extension to show the content of the stream.