Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

CFBookmarkMBS.Available as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Whether bookmark functions are available.
Notes: Returns true on Mac OS X 10.6 or newer.

Feedback, Comments & Corrections

CFBookmarkMBS.CreateBookmarkData(file as folderitem, options as UInt32 = 1024, relativeToURL as folderitem = nil) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Create a string containing an externalizable representation from a folderitem, modified with the given options, including ( at the minimum ) any properties in the propertiesToInclude array which are retrievable from the given url.
Example:
dim file as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
dim Bookmark as string = CFBookmarkMBS.CreateBookmarkData(file, CFBookmarkMBS.kCreationSuitableForBookmarkFile)

MsgBox str(lenb(Bookmark))+" bytes"
Notes:
file: the folderitem to create a bookmark data from.
options: a set of options which control creation of the bookmark data
resourcePropertiesToInclude: Optional, If non-empty, an array of additional properties copied from the url to include in the created bookmark data.
relativeToURL: If non-nil, the created bookmark will be relative to the given url

Lasterror is set.
Returns a string containing an data, which can be later be passed to ResolveBookmarkData.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.CreateBookmarkData(file as folderitem, options as UInt32, resourcePropertiesToInclude() as string, relativeToURL as folderitem = nil) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Create a string containing an externalizable representation from a folderitem, modified with the given options, including ( at the minimum ) any properties in the propertiesToInclude array which are retrievable from the given url.
Notes:
file: the folderitem to create a bookmark data from.
options: a set of options which control creation of the bookmark data
resourcePropertiesToInclude: Optional, If non-empty, an array of additional properties copied from the url to include in the created bookmark data.
relativeToURL: If non-nil, the created bookmark will be relative to the given url

Lasterror is set.
Returns a string containing an data, which can be later be passed to ResolveBookmarkData.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.CreateBookmarkData(URL as CFURLMBS, options as UInt32 = 1024, relativeToURL as CFURLMBS = nil) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Create a string containing an externalizable representation from a URL, modified with the given options, including ( at the minimum ) any properties in the propertiesToInclude array which are retrievable from the given url.
Notes:
URL: the URL to create a bookmark data from.
options: a set of options which control creation of the bookmark data
resourcePropertiesToInclude: Optional, If non-empty, an array of additional properties copied from the url to include in the created bookmark data.
relativeToURL: If non-nil, the created bookmark will be relative to the given url

Lasterror is set.
Returns a string containing an data, which can be later be passed to ResolveBookmarkData.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.CreateBookmarkData(URL as CFURLMBS, options as UInt32 = 1024, relativeToURL as folderitem = nil) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Create a string containing an externalizable representation from a URL, modified with the given options, including ( at the minimum ) any properties in the propertiesToInclude array which are retrievable from the given url.
Notes:
URL: the URL to create a bookmark data from.
options: a set of options which control creation of the bookmark data
resourcePropertiesToInclude: Optional, If non-empty, an array of additional properties copied from the url to include in the created bookmark data.
relativeToURL: If non-nil, the created bookmark will be relative to the given url

Lasterror is set.
Returns a string containing an data, which can be later be passed to ResolveBookmarkData.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.CreateBookmarkData(URL as CFURLMBS, options as UInt32, resourcePropertiesToInclude() as string, relativeToURL as CFURLMBS = nil) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Create a string containing an externalizable representation from a URL, modified with the given options, including ( at the minimum ) any properties in the propertiesToInclude array which are retrievable from the given url.
Notes:
URL: the URL to create a bookmark data from.
options: a set of options which control creation of the bookmark data
resourcePropertiesToInclude: Optional, If non-empty, an array of additional properties copied from the url to include in the created bookmark data.
relativeToURL: If non-nil, the created bookmark will be relative to the given url

Lasterror is set.
Returns a string containing an data, which can be later be passed to ResolveBookmarkData.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.CreateBookmarkData(URL as CFURLMBS, options as UInt32, resourcePropertiesToInclude() as string, relativeToURL as folderitem = nil) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Create a string containing an externalizable representation from a URL, modified with the given options, including ( at the minimum ) any properties in the propertiesToInclude array which are retrievable from the given url.
Notes:
URL: the URL to create a bookmark data from.
options: a set of options which control creation of the bookmark data
resourcePropertiesToInclude: Optional, If non-empty, an array of additional properties copied from the url to include in the created bookmark data.
relativeToURL: If non-nil, the created bookmark will be relative to the given url

Lasterror is set.
Returns a string containing an data, which can be later be passed to ResolveBookmarkData.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.CreateBookmarkData(URL as string, options as UInt32 = 1024, relativeToURL as string = "") as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Create a string containing an externalizable representation from a URL, modified with the given options, including ( at the minimum ) any properties in the propertiesToInclude array which are retrievable from the given url.
Notes:
URL: the URL to create a bookmark data from.
options: a set of options which control creation of the bookmark data
resourcePropertiesToInclude: Optional, If non-empty, an array of additional properties copied from the url to include in the created bookmark data.
relativeToURL: If non-nil, the created bookmark will be relative to the given url

Lasterror is set.
Returns a string containing an data, which can be later be passed to ResolveBookmarkData.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.CreateBookmarkData(URL as string, options as UInt32, resourcePropertiesToInclude() as string, relativeToURL as string = "") as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Create a string containing an externalizable representation from a URL, modified with the given options, including ( at the minimum ) any properties in the propertiesToInclude array which are retrievable from the given url.
Notes:
URL: the URL to create a bookmark data from.
options: a set of options which control creation of the bookmark data
resourcePropertiesToInclude: Optional, If non-empty, an array of additional properties copied from the url to include in the created bookmark data.
relativeToURL: If non-nil, the created bookmark will be relative to the given url

Lasterror is set.
Returns a string containing an data, which can be later be passed to ResolveBookmarkData.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.CreateBookmarkDataFromAliasRecord(AliasRecordData as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Create a string containing bookmarkdata by converting the alias data in aliasRecordData which should be the contents of an AliasRecord copied into a string.
Notes:
The created bookmarkdata can be passed into ResolveBookmarkData to resolve the item into a folderitem or URL, or a small set of information can be returned from ResourcePropertiesForKeysFromBookmarkData / ResourcePropertyForKeyFromBookmarkData.
AliasRecordData: the contents of an AliasRecord to create bookmark data for

Returns a string containing bookmark data.

Feedback, Comments & Corrections

CFBookmarkMBS.LastError as CFErrorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: The last error.
Notes: This ia CFErrorMBS object.

Feedback, Comments & Corrections

CFBookmarkMBS.ReadBookmarkDataFromFile(file as folderitem) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Given a file which is a Finder "alias" file, return a string with the bookmark data from the file.
Notes:
If file points to an alias file created before SnowLeopard which contains Alias Manager information and no bookmark data, then a bookmark data string will be synthesized which contains a approximation of the alias information in a format which can be used to resolve the bookmark. If an error prevents reading the data or if it is corrupt, nil will be returned and lasterror will be filled in if error object.

File: a folderitem to to the alias file to create the bookmark data from.

Returns a string containing bookmark data, or nil if there was an error creating bookmark data from the file, such as if the file is not an alias file.

Feedback, Comments & Corrections

CFBookmarkMBS.ResolveBookmarkData(bookmark as string, options as UInt32, relativeToURL as folderitem, byref isStale as boolean) as folderitem
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Given a bookmark data string, returns a folderitem of the item it was a bookmark to.
Example:
dim AliasFile as FolderItem = SpecialFolder.Desktop.trueChild("test.alias")
dim Bookmark as string = CFBookmarkMBS.ReadBookmarkDataFromFile(AliasFile)
dim isStale as Boolean
dim options as UInt32 = CFBookmarkMBS.kResolutionWithoutUIMask + CFBookmarkMBS.kResolutionWithoutMountingMask
dim file as FolderItem = CFBookmarkMBS.ResolveBookmarkData(Bookmark, options, nil, isStale)

if file<>Nil then
MsgBox file.NativePath
else
dim e as CFErrorMBS = CFBookmarkMBS.LastError
if e = nil then
MsgBox "Failed to resolve."
else
MsgBox e.Description
end if
end if
Notes:
If in the process of resolving the bookmark into the folderitemit points to this determines that some properties in the bookmark are out of date or not correct for the item it resolves to, set isStale to true, which the client may want to use to decide to make a new bookmark from the returned item and replace the saved bookmark it has. If the bookmarked item cannot be found, return nil. If an error ( other than "original item can not be found" ) occurs during the process, return nil and fill in lasterror property )

bookmark: a string containing a bookmark data, created with CreateBookmarkData
options: options which affect the resolution
relativeToURL: If non-nil, and if the bookmark was created relative to another file/folder, then resolve it relative to this file/folder.
resourcePropertiesToInclude: Optional, if non-empty, an array containing those properties which the caller would like to already be cached on the given url.
isStale: On exit will be set to true if during resolution any of the properties in the bookmark no longer seemed to match the corresponding properties on the returned file. Clients, upon seeing a stale representation, may want to replace whatever stored bookmark data they have saved and create a new one.

Lasterror is set.

Returns a folderitem of a file which is the closest match to the file the bookmark data.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.ResolveBookmarkData(bookmark as string, options as UInt32, relativeToURL as folderitem, resourcePropertiesToInclude() as string, byref isStale as boolean) as folderitem
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Given a bookmark data string, returns a folderitem of the item it was a bookmark to.
Notes:
If in the process of resolving the bookmark into the folderitemit points to this determines that some properties in the bookmark are out of date or not correct for the item it resolves to, set isStale to true, which the client may want to use to decide to make a new bookmark from the returned item and replace the saved bookmark it has. If the bookmarked item cannot be found, return nil. If an error ( other than "original item can not be found" ) occurs during the process, return nil and fill in lasterror property )

bookmark: a string containing a bookmark data, created with CreateBookmarkData
options: options which affect the resolution
relativeToURL: If non-nil, and if the bookmark was created relative to another file/folder, then resolve it relative to this file/folder.
resourcePropertiesToInclude: Optional, if non-empty, an array containing those properties which the caller would like to already be cached on the given url.
isStale: On exit will be set to true if during resolution any of the properties in the bookmark no longer seemed to match the corresponding properties on the returned file. Clients, upon seeing a stale representation, may want to replace whatever stored bookmark data they have saved and create a new one.

Lasterror is set.

Returns a folderitem of a file which is the closest match to the file the bookmark data.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.ResolveBookmarkData(bookmark as string, options as UInt32, relativeToURL as string, byref isStale as boolean) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Given a bookmark data string, returns a folderitem of the item it was a bookmark to.
Notes:
If in the process of resolving the bookmark into the folderitemit points to this determines that some properties in the bookmark are out of date or not correct for the item it resolves to, set isStale to true, which the client may want to use to decide to make a new bookmark from the returned item and replace the saved bookmark it has. If the bookmarked item cannot be found, return nil. If an error ( other than "original item can not be found" ) occurs during the process, return nil and fill in lasterror property )

bookmark: a string containing a bookmark data, created with CreateBookmarkData
options: options which affect the resolution
relativeToURL: If non-nil, and if the bookmark was created relative to another file/folder, then resolve it relative to this file/folder.
resourcePropertiesToInclude: Optional, if non-empty, an array containing those properties which the caller would like to already be cached on the given url.
isStale: On exit will be set to true if during resolution any of the properties in the bookmark no longer seemed to match the corresponding properties on the returned file. Clients, upon seeing a stale representation, may want to replace whatever stored bookmark data they have saved and create a new one.

Lasterror is set.

Returns a folderitem of a file which is the closest match to the file the bookmark data.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.ResolveBookmarkData(bookmark as string, options as UInt32, relativeToURL as string, resourcePropertiesToInclude() as string, byref isStale as boolean) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Given a bookmark data string, returns a folderitem of the item it was a bookmark to.
Notes:
If in the process of resolving the bookmark into the folderitemit points to this determines that some properties in the bookmark are out of date or not correct for the item it resolves to, set isStale to true, which the client may want to use to decide to make a new bookmark from the returned item and replace the saved bookmark it has. If the bookmarked item cannot be found, return nil. If an error ( other than "original item can not be found" ) occurs during the process, return nil and fill in lasterror property )

bookmark: a string containing a bookmark data, created with CreateBookmarkData
options: options which affect the resolution
relativeToURL: If non-nil, and if the bookmark was created relative to another file/folder, then resolve it relative to this file/folder.
resourcePropertiesToInclude: Optional, if non-empty, an array containing those properties which the caller would like to already be cached on the given url.
isStale: On exit will be set to true if during resolution any of the properties in the bookmark no longer seemed to match the corresponding properties on the returned file. Clients, upon seeing a stale representation, may want to replace whatever stored bookmark data they have saved and create a new one.

Lasterror is set.

Returns a folderitem of a file which is the closest match to the file the bookmark data.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.ResolveBookmarkDataToCFURLMBS(bookmark as string, options as UInt32, relativeToURL as CFURLMBS, byref isStale as boolean) as CFURLMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Given a bookmark data string, returns a CFURL of the item it was a bookmark to.
Notes:
If in the process of resolving the bookmark into the folderitemit points to this determines that some properties in the bookmark are out of date or not correct for the item it resolves to, set isStale to true, which the client may want to use to decide to make a new bookmark from the returned item and replace the saved bookmark it has. If the bookmarked item cannot be found, return nil. If an error ( other than "original item can not be found" ) occurs during the process, return nil and fill in lasterror property )

bookmark: a string containing a bookmark data, created with CreateBookmarkData
options: options which affect the resolution
relativeToURL: If non-nil, and if the bookmark was created relative to another file/folder, then resolve it relative to this file/folder.
resourcePropertiesToInclude: Optional, if non-empty, an array containing those properties which the caller would like to already be cached on the given url.
isStale: On exit will be set to true if during resolution any of the properties in the bookmark no longer seemed to match the corresponding properties on the returned file. Clients, upon seeing a stale representation, may want to replace whatever stored bookmark data they have saved and create a new one.

Lasterror is set.

Returns a CFURLMBS of a file which is the closest match to the file the bookmark data.

See also:

Some examples which use this method:

Feedback, Comments & Corrections

CFBookmarkMBS.ResolveBookmarkDataToCFURLMBS(bookmark as string, options as UInt32, relativeToURL as CFURLMBS, resourcePropertiesToInclude() as string, byref isStale as boolean) as CFURLMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Given a bookmark data string, returns a CFURL of the item it was a bookmark to.
Notes:
If in the process of resolving the bookmark into the folderitemit points to this determines that some properties in the bookmark are out of date or not correct for the item it resolves to, set isStale to true, which the client may want to use to decide to make a new bookmark from the returned item and replace the saved bookmark it has. If the bookmarked item cannot be found, return nil. If an error ( other than "original item can not be found" ) occurs during the process, return nil and fill in lasterror property )

bookmark: a string containing a bookmark data, created with CreateBookmarkData
options: options which affect the resolution
relativeToURL: If non-nil, and if the bookmark was created relative to another file/folder, then resolve it relative to this file/folder.
resourcePropertiesToInclude: Optional, if non-empty, an array containing those properties which the caller would like to already be cached on the given url.
isStale: On exit will be set to true if during resolution any of the properties in the bookmark no longer seemed to match the corresponding properties on the returned file. Clients, upon seeing a stale representation, may want to replace whatever stored bookmark data they have saved and create a new one.

Lasterror is set.

Returns a CFURLMBS of a file which is the closest match to the file the bookmark data.

See also:

Some examples which use this method:

Feedback, Comments & Corrections

CFBookmarkMBS.ResolveBookmarkDataToCFURLMBS(bookmark as string, options as UInt32, relativeToURL as folderitem, byref isStale as boolean) as CFURLMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Given a bookmark data string, returns a CFURL of the item it was a bookmark to.
Notes:
If in the process of resolving the bookmark into the folderitemit points to this determines that some properties in the bookmark are out of date or not correct for the item it resolves to, set isStale to true, which the client may want to use to decide to make a new bookmark from the returned item and replace the saved bookmark it has. If the bookmarked item cannot be found, return nil. If an error ( other than "original item can not be found" ) occurs during the process, return nil and fill in lasterror property )

bookmark: a string containing a bookmark data, created with CreateBookmarkData
options: options which affect the resolution
relativeToURL: If non-nil, and if the bookmark was created relative to another file/folder, then resolve it relative to this file/folder.
resourcePropertiesToInclude: Optional, if non-empty, an array containing those properties which the caller would like to already be cached on the given url.
isStale: On exit will be set to true if during resolution any of the properties in the bookmark no longer seemed to match the corresponding properties on the returned file. Clients, upon seeing a stale representation, may want to replace whatever stored bookmark data they have saved and create a new one.

Lasterror is set.

Returns a CFURLMBS of a file which is the closest match to the file the bookmark data.

See also:

Some examples which use this method:

Feedback, Comments & Corrections

CFBookmarkMBS.ResolveBookmarkDataToCFURLMBS(bookmark as string, options as UInt32, relativeToURL as folderitem, resourcePropertiesToInclude() as string, byref isStale as boolean) as CFURLMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Given a bookmark data string, returns a CFURL of the item it was a bookmark to.
Notes:
If in the process of resolving the bookmark into the folderitemit points to this determines that some properties in the bookmark are out of date or not correct for the item it resolves to, set isStale to true, which the client may want to use to decide to make a new bookmark from the returned item and replace the saved bookmark it has. If the bookmarked item cannot be found, return nil. If an error ( other than "original item can not be found" ) occurs during the process, return nil and fill in lasterror property )

bookmark: a string containing a bookmark data, created with CreateBookmarkData
options: options which affect the resolution
relativeToURL: If non-nil, and if the bookmark was created relative to another file/folder, then resolve it relative to this file/folder.
resourcePropertiesToInclude: Optional, if non-empty, an array containing those properties which the caller would like to already be cached on the given url.
isStale: On exit will be set to true if during resolution any of the properties in the bookmark no longer seemed to match the corresponding properties on the returned file. Clients, upon seeing a stale representation, may want to replace whatever stored bookmark data they have saved and create a new one.

Lasterror is set.

Returns a CFURLMBS of a file which is the closest match to the file the bookmark data.

See also:

Some examples which use this method:

Feedback, Comments & Corrections

CFBookmarkMBS.ResourcePropertiesForKeysFromBookmarkData(BookmarkData as string) as dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Given a bookmark, return a dictionary of all properties.
Example:
dim f as FolderItem = SpecialFolder.Desktop.TrueChild("Webseiten")

dim data as string = CFBookmarkMBS.ReadBookmarkDataFromFile(f)

if data.lenb > 0 then
dim dic as Dictionary = CFBookmarkMBS.ResourcePropertiesForKeysFromBookmarkData(data)

Break // see in debugger
end if
Notes:
This returns only the properties stored within the bookmark and will not attempt to resolve the bookmark or do i/o.

BookmarkData: a string containing a bookmark data, created with CreateBookmarkData

Returns a dictionary containing the values for all properties passed in obtained from the bookmark data ( not by attempting to resolve it or do i/o in any way )

Version 17.1 of our plugin knows a list of keys, so it tries all keys and returns the dictionary with matching ones.

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.ResourcePropertiesForKeysFromBookmarkData(BookmarkData as string, resourcePropertiesToReturn() as string) as dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Given a bookmark, return a dictionary of properties.
Notes:
This returns only the properties stored within the bookmark and will not attempt to resolve the bookmark or do i/o.

BookmarkData: a string containing a bookmark data, created with CreateBookmarkData
resourcePropertiesToReturn: Optional an array of string of the properties of the bookmark data which the client would like returned.

Returns a dictionary containing the values for the properties passed in obtained from the bookmark data ( not by attempting to resolve it or do i/o in any way )

See also:

Feedback, Comments & Corrections

CFBookmarkMBS.ResourcePropertyForKeyFromBookmarkData(BookmarkData as string, resourcePropertyKey as string) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Given a bookmark, return the value for a given property from the bookmark data.
Notes:
This returns only the properties stored within the bookmark and will not attempt to resolve the bookmark or do i/o.
BookmarkData: a string containing a bookmark data, created with CreateBookmarkData
resourcePropertyKey: the property key to return.

Returns a variant value for the property passed in obtained from the bookmark data ( not by attempting to resolve it or do i/o in any way )

Feedback, Comments & Corrections

CFBookmarkMBS.StartAccessingSecurityScopedResource(URL as CFURLMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Given a file URL created by resolving a bookmark data created with security scope, make the resource referenced by the url accessible to the process.
Notes:
When access to this resource is no longer needed the client should call StopAccessingSecurityScopedResource(). Each call to StartAccessingSecurityScopedResource() must be balanced with a call to StopAccessingSecurityScopedResource().
URL: the file URL for the resource returned by CreateByResolvingBookmarkData() using kResolutionWithSecurityScope.

Returns true if access was granted and false if the url does not reference a security scoped resource, or if some error occurred which didn't allow access to be granted.
Available on Mac OS X 10.7 or newer.

Feedback, Comments & Corrections

CFBookmarkMBS.StopAccessingSecurityScopedResource(URL as CFURLMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 14.1 Yes No No Yes, macOS only No
Function: Revokes the access granted to the url by a prior successful call toStartAccessingSecurityScopedResource().
Notes: Available on Mac OS X 10.7 or newer.

Feedback, Comments & Corrections

CFBookmarkMBS.WriteBookmarkDataToFile(BookmarkData as string, file as folderitem, options as UInt32) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Alias MBS MacCF Plugin 11.3 Yes No No Yes, macOS only No
Function: Given a created bookmarkData object, create a new Finder "alias" file at file which contains the bookmark data.
Example:
dim file as FolderItem = SpecialFolder.Desktop.TrueChild("test.rtf")
dim Bookmark as string = CFBookmarkMBS.CreateBookmarkData(file, CFBookmarkMBS.kCreationSuitableForBookmarkFile)

dim AliasFile as FolderItem = SpecialFolder.Desktop.TrueChild("test.alias")
if CFBookmarkMBS.WriteBookmarkDataToFile(Bookmark, AliasFile, 0) then
MsgBox "OK"
else
dim e as CFErrorMBS = CFBookmarkMBS.lasterror
MsgBox "Failed: "+e.Description
end if
Notes:
If file points to a directory, an alias file will be created with the same name as the bookmarked item and a ".alias" extension. If file points to a file and it exists it will be overwritten. If a .alias extension is not present it will be added. In addition to the bookmark data, sufficient pre-SnowLeopard alias data will added to the file to allow systems running something before SnowLeopard to resolve this file using Alias Manager routines and get back the same file as the bookmark routines.

The bookmark data must have been created with the kCFURLBookmarkCreationSuitableForBookmarkFile option and an error will be returned if not.

bookmark: A string containing a bookmark data, created with CreateBookmarkData
file: The file/folder to write the alias to.
options: options flags

Lasterror is set.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacCF Plugin.

The biggest plugin in space...




Links
MBS Xojo tutorial videos