Questions tagged [pasteboard]
53 questions
1
vote
1 answer
UIPasteboard unable to copy text with expiration time multiple times
I'm calling:
UIPasteboard.general.setItems([[kUTTypePlainText as String: text]], options: [.localOnly: true, .expirationDate: expirationTime])
to copy text per button click. However, after the expiration time has elapsed (30 seconds), the copy…

apunn
- 97
- 8
1
vote
1 answer
Is it possible to access Mac OSX clipboard data from within a Sublime Text 3 Snippet?
For instance, I would like to build a snippet that creates a simple anchor tag in HTML and uses my clipboard data to fill in the href property and the text node of the anchor tag itself.
Here is an example of what that code might look like:

Justin
- 11
- 2
1
vote
0 answers
IKImageBrowserView: Drag & Drop Error
I'm using an IKImageBrowserView and get the error described here. So I should use NSURLs instead of NSStrings/paths. I have changed everything to NSURL now, but get still the same error. I tried using IKImageBrowserNSURLRepresentationType and…

ChuckThePlant
- 21
- 5
1
vote
2 answers
iOS - Check pasteboard for valid Mailing Address
I am looking for some guidance for how I could check the pasteboard in iOS for a valid mailing address.
If someone pastes
1234 Apple Street
New York, NY 10011
It parses each part of the string to fill in Address, City, State and Zip. It could be…

Wes
- 419
- 1
- 4
- 18
1
vote
2 answers
How to get data in iOS pasteboard to stay multiple access
What I'm trying to do currently is basically I have 2 apps and based on if the other one is installed or not, behave in a certain way. I came upon Pasteboard for inter-app communication so I thought I should use those. Well here is the problem, both…

user1289479
- 291
- 4
- 16
1
vote
1 answer
Does the Data in UIPasteboard persist through system reboots?
My question is very simple, I basically have 2 apps that want to access a pasteboard that I created for the 2 apps. What I want to know is lets say I saved a string to the pasteboard, and shut off the phone. When I restart the phone and open the 2nd…

user1289479
- 291
- 4
- 16
0
votes
0 answers
Is there a way to globally detect paste, cut, copy events using UIPasteboard in swift?
Hello I would like to know any time a user cut, copy, paste using UIPasteboard is this possible to detect at a global level? When the user copies, cuts or paste the app is active, those events are the events I would like to track.

kelson_99
- 37
- 2
0
votes
0 answers
macOS AppKit : Custom classes on pasteboard
In 2009 I wrote a macOS app centered on Core Data objects. As I recall, at the time there were some issues with putting Core Data or any custom object on the Cocoa system pasteboard (NSPasteboard), and the recommended workaround was to implement…

Jerry Krinock
- 4,860
- 33
- 39
0
votes
2 answers
Do pyperclip3 or pasteboard support paste of PNG on macOS
I am trying to figure out how to paste a PNG graphic from the clipboard into a Python script on macOS. I have looked into using the pyperclip, pyperclip3, and pasteboard modules. I cannot get any of these to work. I am able to paste text from the…

MikeMayer67
- 570
- 6
- 17
0
votes
1 answer
X11 Copy is returning only returning GDK_SELECTION, for CLIPBOARD Selection
I am writing a component which has to monitor changes in CLIPBOARD for a X11 window.
auto display = XOpenDisplay(NULL);
auto screen = DefaultScreen(mdisplay);
auto root_window = RootWindow(display, screen);
clipboard = XInternAtom(display,…

kishoredbn
- 2,007
- 4
- 28
- 47
0
votes
0 answers
How to override Copy and Paste NSMenuItems for one View Controller Swift macOS
I am writing a macOS application with multiple view controllers, using Storyboards.
In my main View Controller I would like to be able to copy and paste data to the NSPasteboard. The data is related to buttons displayed to the user, and the exact…

Daniel Higgott
- 51
- 5
0
votes
0 answers
Load mp4 to pasteboard in swift
I'm developing an app in both Swift 4 and Objective-C that loads a set of m4a audio files (tried local and via http) to pasteboard.
Basically, this works when loading text to pasteboard
let pasteBoard = UIPasteboard.general
pasteBoard.string…
0
votes
0 answers
decode and encode nsmanagedobject
good morning :)
i would like to use pasteboard with an nsmanagedobject.
This is my class:
import Foundation
import CoreData
@objc(Persons)
public class Persons: NSManagedObject {
@NSManaged public var firstName: String?
@NSManaged public…

Trombone0904
- 4,132
- 8
- 51
- 104
0
votes
1 answer
Has 'kUTTypeFlatRTFD' been renamed?
When trying to access the constant kUTTypeFlatRTFD (or any of the text types for that matter) I get the issue that it is an unresolved identifier.
It appears to not be deprecated, and available as part of…

Jake Chasan
- 6,290
- 9
- 44
- 90