Skip to content

Instantly share code, notes, and snippets.

@raphlinus
Created August 10, 2019 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raphlinus/52dd3be6f4ac9590318286aa3e427c0a to your computer and use it in GitHub Desktop.
Save raphlinus/52dd3be6f4ac9590318286aa3e427c0a to your computer and use it in GitHub Desktop.
simple toy for inspecting pasteboard types
//
// AppDelegate.m
// Pasteboard toy
//
// Created by Raph Levien on 8/10/19.
// Copyright © 2019 Raph Levien. All rights reserved.
//
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
NSArray *items = [[NSPasteboard generalPasteboard] pasteboardItems];
NSLog(@"Number of pasteboard items: %lu", [items count]);
for (int i = 0; i < [items count]; i++) {
NSPasteboardItem *item = items[i];
NSArray<NSPasteboardType> *types = [item types];
NSLog(@"Item %i, number of types: %lu", i, [types count]);
for (int j = 0; j < [types count]; j++) {
NSLog(@"%@", types[j]);
}
}
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment