I understand that printerSettings is something called an opaque binary file that I can only set or get in its entirety, but I don't understand how to save it because I don't know what kind of file to save it as. I imagine the file type may be different for Windows and for OS X.
From the LiveCode Dictionary:
Examples:
set the printerSettings to the cSavedPrintSettings of me
put the printerSettings into url ("binfile:" & printerSettingsFile())
It looks like that first line is pulling printerSettings from a variable. That second line is what I want to do except I don't understand what the printerSettingsFile() is all about. It looks like some sort of custom function.
So I'm left with the question: How do I save printerSettings to a file in both Windows and OS X? What file extension do I use?
How do I save printerSettings?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Fri Nov 10, 2006 8:58 pm
- Contact:
Re: How do I save printerSettings?
Hi Stephen,
Like this:
...
put specialfolderpath("desktop") & "/myprintersettings" into tSettingsFile
put the printersettings into url("binfile:" & tSettingsFile)
## Done
...
1, Whatever you want
2. None
Suffix does not matter at all, since you/your app knows what the content of that file if meant ot do!
Best
Klaus
The filetype does not matter, as long as you save to a "binfile:".stephenmcnutt wrote:I understand that printerSettings is something called an opaque binary file that I can only set or get in its entirety, but I don't understand how to save it because I don't know what kind of file to save it as. I imagine the file type may be different for Windows and for OS X.
Yep, almost, in this example from a custom property.stephenmcnutt wrote:...
Examples:
set the printerSettings to the cSavedPrintSettings of me
put the printerSettings into url ("binfile:" & printerSettingsFile())
It looks like that first line is pulling printerSettings from a variable.
Yes, just a bad example. You can supply ANY valid filename here.stephenmcnutt wrote:That second line is what I want to do except I don't understand what the printerSettingsFile() is all about. It looks like some sort of custom function.
Use a place where your app is allowed to write like the users desktop or documents folder (or a subfolder for you app or...)stephenmcnutt wrote:So I'm left with the question: How do I save printerSettings to a file in both Windows and OS X?
Like this:
...
put specialfolderpath("desktop") & "/myprintersettings" into tSettingsFile
put the printersettings into url("binfile:" & tSettingsFile)
## Done

...
Two options:stephenmcnutt wrote:What file extension do I use?
1, Whatever you want

2. None

Suffix does not matter at all, since you/your app knows what the content of that file if meant ot do!

Best
Klaus