Skip to content

Commit 4e5c714

Browse files
authored
Merge pull request #1 from thypon/master
never upload to icloud Runs a check first to ensure current macOS version supports this feature of the pasteboard. 🙏🏻 to @thypon for submitting this PR
2 parents 9e91917 + 2c44f21 commit 4e5c714

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pbsecret.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ int main (int argc, char* const argv[]) {
9797
NSPasteboard* pasteboard= [NSPasteboard generalPasteboard];
9898
[pasteboard clearContents];
9999

100+
if ([pasteboard respondsToSelector:@selector(prepareForNewContentsWithOptions)]) {
101+
NSPasteboardContentsOptions options = NSPasteboardContentsCurrentHostOnly;
102+
[pasteboard prepareForNewContentsWithOptions:options];
103+
}
104+
100105
[pasteboard setData: [@"" dataUsingEncoding:NSUTF8StringEncoding] forType: @"org.nspasteboard.ConcealedType"];
101106
[pasteboard setData: inputData forType: @"NSStringPboardType"];
102107

0 commit comments

Comments
 (0)