Questions tagged [nspasteboard]

NSPasteboard is the Cocoa class representation for clipboard data, allowing information to be copied and pasted within and between programs. NSPasteboards also represent information that is being dragged within or among programs.

161 questions
0
votes
1 answer

Replacing latest item with second-latest item in NSPasteboard

Is there a way to globally remove the current item from the pasteboard (the item that will show up on pressing Command+V in any app) and make it so that pressing Command+V pastes the last copied item? Say I copy foo and then bar, I press a button in…
Kaatt
  • 1,061
  • 1
  • 8
  • 10
0
votes
2 answers

Is there a way to check what pasteboard items an application will accept?

From my understanding of how the pasteboard works, is when a paste request is issued, the requester also indicates which data types it allows. Is there a way to get this information about an app before the paste request is issued?
Flawed_Logicc
  • 145
  • 1
  • 10
0
votes
1 answer

NSServices : "How to create new file in Finder" with Sandbox App

I try to add a service to my application. This application has a service called, let's say, "MyService". I have a file in the Finder and I would like to copy that file with a new name at the same location. The user would right-click on the file and…
0
votes
1 answer

Why does -[NSPasteboard readObjectsForClasses:options:] return only 1 item from a drag?

I'm writing a number of objects to NSPasteboard for a drag operation using beginDraggingSessionWithItems:event:source:: NSMutableArray *draggingItems = [NSMutableArray array]; for (NSUInteger i = 0; i < numItems; i++) { NSPasteboardItem…
jtbandes
  • 115,675
  • 35
  • 233
  • 266
0
votes
2 answers

Write NSDictionary to NSPasteboard

I have a dictionary containing an image in NSData format, the size of the image along with other attributes of image. How can i write an NSDictionary to NSPasteboard? I wrote the code as following: NSPasteboard *pasteBoard = [NSPasteboard…
0
votes
1 answer

Why is Xcode's Search Navigator pulling searches from Safari?

I often have Safari open while working on a project in Xcode, looking up stuff on Stack Overflow and the like. A few times, I've searched something in to the web address/search engine field of Safari, and a word or two from what I typed in and it…
Eliza Wilson
  • 1,031
  • 1
  • 13
  • 38
0
votes
1 answer

NSPasteboard readObjectsForClasses:options: returns value twice

Right to the point, then: First snippet (AppDelegate): - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { //...code taken out... [NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask handler:^(NSEvent…
0
votes
2 answers

Accept drag'n'drop from iPhoto or Aperture

I've created an app, containing an ImageView subclass which accepts drag'n'dropping files/folders directly from Finder. The thing is I'm now trying to make it accept photos, either from iPhoto or Aperture, as well. Which PboardTypes should I…
Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223
0
votes
1 answer

Cut & paste of files with NSPasteboard

How are we supposed to cut & paste files using NSPasteboard? Currently I implemented copy and paste by writing and reading file URLs. The problem with cut is, that after I wrote the URL to the pasteboard, I have to remove the file. And when I try to…
DrummerB
  • 39,814
  • 12
  • 105
  • 142
-1
votes
0 answers

Is there any way to monitor paste events on macos

I am trying to create a tool that monitors illicit content pasting. I need help on how to monitor a paste event. I have tried utilizing NSPasteboard change count but cannot get the paste event details from it. Can anyone provide an example for the…
-1
votes
1 answer

When I use NSPasteboard I met Undefined symbols for architecture x86_64

Possible Duplicate: symbol(s) not found in XCode, Cocoa application Below is the error information Undefined symbols for architecture x86_64: "_NSPasteboardTypeString", referenced from: _main in main.o "_OBJC_CLASS_$_NSPasteboard",…
Cuero
  • 1,169
  • 4
  • 21
  • 42
1 2 3
10
11