Hi all,
REALbasic 2007 Release 1
Mac OS X 10.4.8 (but I think the LR is platform independant)
FolderItem Class
Examples
search:
<quote>
The following example creates a text file, changes the Creator from the default
creator of "R*ch" to "ttxt", and writes some data to the file.
Dim f as FolderItem
Dim stream as TextOutputStream
f= GetSaveFolderItem("TEXT","Daily Planet Staff") // See [*] far below
stream=f.CreateTextFile
f.MacCreator="ttxt"
Stream.WriteLine ("Perry White")
Stream.WriteLine ("Lois Lane")
Stream.WriteLine ("Jimmy Olsen")
Stream.Close
</quote>
Isn't "R*ch" a File Type ? And "ttxt" an Application Creator (in this case
SimpleText - Mac OS 9 and lower - TextEdit - Mac OS X, all flavors - ) ?
After a check with AppleScript, I get:
file type: "TEXT",
creator type: "ttxt"
OK, this is an error. Can you correct it ? TIA,
Emile
[*] Why do you leave the file name without an extension ?
I saw that in some other examples [GetSaveFolderItem]
But the second example below "Using GetRelative" have the extension (jpg)...
Also, if the user cancels the operation on the line [*], he will fall into the
debugger... but not if (s)he use the second example below "Using GetRelative"
where a report "LastErrorCode / Picture saved!" is issued.
To fully understand what I wrote, read and execute the example in the
SaveAsDialog Class: both the extension is (automatically) set and there is an
error checking! (beware at the FileType: place one if you do not have a
"TextTypes.text" defined.
BTW: this allows me to spend my time and I still do not have found what I was
searching... in the beginning (of this quest)...
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>