// -----------------------------------------------------------------------------
// – Request for shortest example possible
// – of security scoped bookmarks
// -----------------------------------------------------------------------------
Can anyone write an old-school late '70’s early '80’s teaching explanation using top down programming example in XOJO instead of using abstraction?
//----------------------------------------------
// – App Description and issue:
//----------------------------------------------
My small backup app stores the folder the user select and the paths to the files within that folder in a database in plain text for future reference. In order to submit my app to the app store, It has to use security scoped bookmarks.
// -----------------------------------------------------------------------------
// – Instructions / Request:
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// – Needed: A Security Scoped Bookmarks Tutorial
// –
// – Preferences for this tutorial
// – 1. Use as few objects as possible
// – 2. NO abstraction unless unavoidable
// – 3. NO classes
// – 4. NO modules
// – 5. Use the MBS Plugin if you have it
// – 6. Explain each line of code like you are teaching it.
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// – Step 1 - have the user select a folder
// – to access the items within that folder
// – Show the path to the folder in a listbox
// -----------------------------------------------------------------------------
Var f as FolderItem // -- create a variable to hold a folder path
f = FolderItem.ShowSelectFolderDialog() // -- present the user with a dialogBox to pick a folder
Listbox1.AddRow(f.NativePath) // -- put the text version of that path into a listbox
// -----------------------------------------------------------------------------
// – Using MBS example start
// – do I even need to capture this as a string?
// -----------------------------------------------------------------------------
Var aBookmark as string // -- create string holder
// ----------------------------------------------------------------------
// -- assign the bookmark as text to aBookmark - is this even necessary?
// ----------------------------------------------------------------------
aBookmark = CFBookmarkMBS.CreateBookmarkData(f,CFBookmarkMBS.kCreationSuitableForBookmarkFile)
// -----------------------------------------------------------------------------
// -- What is Apples requirement for saving?
// -- a.
// -- b. etc...
// --
// -- How to Start Using...
// --
// -- How to Stop Using...
// --
// -- How to start using again...
// --
// -- Other issues concerns?...
// --
// -----------------------------------------------------------------------------