MBS Plugin Documentation
Statistics - FAQ - Plugin Parts (All, Dependencies) - Class hierarchie
New in Version 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 9.0
The list of the themes, classes, controls, modules, global methods by category, global methods by name, screenshots, licenses and examples.
Platforms to show: All Mac Windows Linux Cross-Platform
FAQ.How to check whether a folderitem is in the LoginItems?
Feedback.
Answer: The following code may help to check for a folderitem in the login items:
Example:
This will not work with pathes relative to the user's local folder.
You may better add a second check for the application name as there may already be another version of your application being registered.
Feedback.
Answer: The following code may help to check for a folderitem in the login items:
Example:
Function isFolderItemInLoginItems(item as folderitem) As boolean
dim c as integer
dim s as string
dim i as integer
dim u as CFURLMBS
dim path as string
u=NewCFURLMBSFile(item)
path=u.PosixFileSystemPath.str
c=CountOfLoginItemsMBS(false)
for i=1 to c
s=LoginItemPropertyAtIndexMBS(1,i,false)
if s=path then
Return true
end if
next
Exception e
Return false
End Function
// An example on how to use it:
dim f as FolderItem
f=ApplicationsFolderMBS(0).Child("iChat.app")
if isFolderItemInLoginItems(f) then
MsgBox "iChat is in the Login items."
else
MsgBox "iChat is not in the Login items."
end if
Notes: This will not work with pathes relative to the user's local folder.
You may better add a second check for the application name as there may already be another version of your application being registered.
Monkeybread Software Realbasic Plugins - Nikolausrede