find /home -size 1G
. find /home -type f -name *.avi -size +2G -exec rm {}
find /home -size +30M -size -100M
. This command will locate all files that are greater than 30MB but less than 100MB. FIFinderSync
class. This subclass acts as your extension’s primary class. The system automatically instantiates this class and calls the protocol methods in response to user actions.info.plist
file must contain the following entries:<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict/>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.FinderSync</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).FinderSync</string>
</dict>
NSExtensionPrincipalClass
key must provide the name of your FIFinderSync
subclass. The system automatically instantiates this class when the Finder first launches. It instantiates an additional copy whenever an Open or Save dialog is displayed. Each copy runs in its own process.Info.plist
keys automatically. If you want to change the principal class, modify the value of the NSExtensionPrincipalClass
key.init
method, using the default FIFinderSyncController
object. In most cases, you want to let the user specify these folders in UI provided by the containing app. You can pass this data between the containing app and your Finder Sync extension using shared user defaults.com.apple.security.application-groups
entry to the targets’ entitlements.<key>com.apple.security.application-groups</key>
<array>
<string>com.example.domain.MyFirstFinderSyncApp</string>
</array>
NSUserDefaults
object by calling initWithSuiteName:
and passing in the shared group’s identifier. This init
method creates a user default object that loads and saves data to the shared container. // Set up the folder we are syncing.
NSUserDefaults *sharedDefaults =
[[NSUserDefaults alloc] initWithSuiteName:@'com.example.domain.MyFirstFinderSyncExtension'];
self.myFolderURL = [sharedDefaults URLForKey:MyFolderKey];
if (self.myFolderURL nil) {
self.myFolderURL = [NSURL fileURLWithPath:[@'~/Documents/MyFirstFinderSyncExtension Documents' stringByExpandingTildeInPath]];;
}
[FIFinderSyncController defaultController].folderURLs = [NSSet setWithObject:self.myFolderURL];
setBadgeImage:label:forBadgeIdentifier:
method, as shown here:[[FIFinderSyncController defaultController]
setBadgeImage: uploadedImage
label: NSLocalizedString(@'Uploaded', nil)
forBadgeIdentifier: @'UploadComplete'];
FIFinderSync
protocol declares a number of methods that you can implement to monitor and control the Finder. These methods let you receive notifications when the user observes monitored items, add contextual menus to monitored items, and add custom toolbar and sidebar icons.beginObservingDirectoryAtURL:
only once for each unique URL. As long as the content remains visible in at least one Finder window, any additional Finder windows that open to the same URL are ignored.beginObservingDirectoryAtURL:
, even if the folder is already open in a Finder window. beginObservingDirectoryAtURL:
, the Open and Save dialogs are tracked separately from the Finder.setBadgeIdentifier:forURL:
method to set the appropriate badge. You might also want to track these URLs, in order to update their badges whenever their state changes.menuForMenuKind:
method to provide a custom contextual menu. The menu
argument indicates the type of menu that your extension should create. Each menu kind corresponds to a different type of user interaction.FIMenuKindContextualMenuForItems
FIMenuKindContextualMenuForContainer
FIMenuKindContextualMenuForSidebar
FIMenuKindToolbarItemMenu
targetedURL
and selectedItemURLs
methods. The targetedURL
method returns the URL of the file or folder that the user Control-clicked. The selectedItemURLs
method returns an array containing the URLs of all the currently selected items in the Finder window.targetedURL
and selectedItemURLs
return valid values only inside the menuForMenuKind:
method or inside one of its menu actions. If the user is not browsing the monitored folder (for example, if the user clicked the toolbar button while outside the monitored folder), both of these methods return nil
.toolbarItemName
—Return the button’s nametoolbarItemImage
—Return the button’s imagetoolbarItemToolTip
—Return the tooltip text for the buttonmenuForMenuKind:
method, passing FIMenuKindToolbarItemMenu
as the menu kind. Your extension must return an appropriate menu. The system then displays this menu..iconset
. You can pick any name you want for the folder name, but it must end with the .iconset
extension. Filename | Image size |
---|---|
icon_16x16.png | 16 x 16 px |
32 x 32 px | |
icon_32x32.png | 32 x 32 px |
64 x 64 px | |
icon_128x128.png | 128 x 128 px |
256 x 256 px | |
icon_256x256.png | 256 x 256 px |
512 x 512 px | |
icon_512x512.png | https://ionrenew305.weebly.com/blog/prey-mac-app-store. 512 x 512 px |
1024 x 1024 px |
File Name | Image Size |
---|---|
sidebar_16x16.png | 16 x 16 px |
32 x 32 px | |
sidebar_18x18.png | 32 x 32 px |
64 x 64 px | |
sidebar_32x32.png | 128 x 128 px |
256 x 256 px |
info.plist
. Add an entry for the Icon File (CFBundleIconFile
). The value should be the name of your iconset folder (everything before the .iconset
extension). beginObservingDirectoryAtURL:
when the user first opens the monitored folder or one of its subfolders.requestBadgeIdentifierForURL:
for each item that is currently being drawn onscreen. Inside this method, do the following:setBadgeIdentifier:forURL:
.setBadgeIdentifier:forURL:
.endObservingDirectoryAtURL:
when the user closes the folder. Delete all the URLs for the badged items inside that folder and stop monitoring their state.