Sorry all didn't make myself clear. The "oddity" was not that Mac apps
are packages. The "oddity" is that the properties cannot be saved when
you quit the app because they are (ostensibly) part of the executable.
I believe that was the reason given for the fact that a revolution
executable property set would not survive a quit and relaunch (when in
fact an Applescript executable's properties are saved).
If that is not the case, if the properties are not attached to the
executable, then there really isn't a reason why the app cannot store
properties inside the package, or at least save them on quitting the
app.
But that is a story for another thread. This is really academic as I
can write my own property saving method, or even use low level file
functions inside the package to accomplish the same thing.
Bob Sneidar
IT Manager
Logos Management
Calvary Chapel CM
On Feb 16, 2009, at 11:55 AM, Richard Gaskin wrote:
Bob Sneidar wrote:
Oh gotcha! So you are saying that the properties are something that
is a part of the executable inside the package? How odd.
The confusion stems from OS X lying to us: it tells us that an
application is a file, when it's really a folder. :)
The actual executable (the runtime engine bound to your stack) is
inside that folder in /Contents/MacOS/. That executable is
essentially the same as you get on Win and Linux, except that on OS
X it's buried inside of these other folders comprising the
"bundle". This executable cannot modify itself at runtime, and I
don't believe any of the supported OSes allow any executable to
modify themselves.
But as you've found, just about any data file be modified, including
those stored in the bundle (with appropriate permissions).
While it's possible to write data into the bundle, the OS X HIG
suggests using the Application Support folder or Preferences for
that. The equivalent to Application Support in Win is Application
Data. You can get the paths to these using Rev's specialFolderPath
function:
-- OS X: Application Support
get specialFolderPath("asup")
-- OS X: Preferences:
get specialFolderPath("preferences")
-- Win: Application Data:
get specialFolderPath(26)
For a complete list of constants for special folders on OS X and Win:
<http://sonsothunder.com/devres/revolution/tips/file010.htm>
As Paul noted, one advantage to storing your user's data outside of
the bundle is that they can upgrade the application without losing
their data.
--
Richard Gaskin
Fourth World
Revolution training and consulting: http://www.fourthworld.com
Webzine for Rev developers: http://www.revjournal.com
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution