01-05-2021
Pasteboard Viewer
Mac OS X Pasteboard Viewer : NSPasteboard extract
Pasteboard Viewer Download
writeOutPasteboard.m
Pasteboard Viewer is described as 'Inspect the system pasteboards on macOS' and is an app in the Office & Productivity category. There are more than 25 alternatives to Pasteboard Viewer for a variety of platforms, including Mac, iPhone, iPad, Windows and Linux. The most liked alternative is Alfred, which is free. Your favourite OSX command line clipboard manipulation libraries pbcopy and pbpasteported over to Windows. Pbcopy copies the standard input and places it in the specified pasteboard.
#import<Foundation/Foundation.h> |
#import<AppKit/AppKit.h> |
intmain(int argc, char *argv[]) { |
@autoreleasepool { |
NSPasteboard *pasteboard = [NSPasteboardgeneralPasteboard]; |
NSLog(@'items: %@', pasteboard.pasteboardItems); |
for (NSPasteboardItem *item in pasteboard.pasteboardItems) { |
NSLog(@'types: %@', item.types); |
for (NSString *type in item.types) { |
NSData *data = [item dataForType:type]; |
NSString *string = [item stringForType:type]; |
NSLog(@'%@: %@', type, string); |
NSLog(@'%@: %@', type, data); |
NSString *writeOutPath = [NSStringstringWithFormat:@'~/Temp/%@', type]; |
writeOutPath = [writeOutPath stringByExpandingTildeInPath]; |
[data writeToFile:writeOutPath atomically:YES]; |
} |
} |
} |
} |
commented Feb 2, 2016
Pasteboard Viewer Online
I recommend running this with CodeRunner |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment