Add a pref panel to set a format for the "Save as…" name.
This commit is contained in:
7 files changed
+421
-4
No files matched your search
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13770" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13770"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="OutputPrefsViewController" customModule="Subler" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="movieField" destination="i8H-oP-Sif" id="DPb-TH-ZiT"/>
|
||||
<outlet property="tvShowField" destination="rzc-AK-4Vr" id="Hqx-Fn-5zF"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="610" height="160"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="PZS-8W-dno">
|
||||
<rect key="frame" x="71" y="124" width="180" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Set filename of Movies to:" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="wci-gO-GWT">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="BZm-iR-6oK" name="value" keyPath="values.SBSetMovieFormat" id="ss4-jH-dVF"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="TBF-BD-fSk">
|
||||
<rect key="frame" x="71" y="48" width="197" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Set filename of TV Shows to:" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="kQC-bu-0by">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="BZm-iR-6oK" name="value" keyPath="values.SBSetTVShowFormat" id="e2b-dq-8JE"/>
|
||||
</connections>
|
||||
</button>
|
||||
<tokenField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="i8H-oP-Sif">
|
||||
<rect key="frame" x="105" y="96" width="400" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="400" id="6Ap-Ey-VHf"/>
|
||||
</constraints>
|
||||
<tokenFieldCell key="cell" selectable="YES" editable="YES" borderStyle="bezel" alignment="left" drawsBackground="YES" allowsEditingTextAttributes="YES" id="h4P-Ma-djC">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</tokenFieldCell>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="39Q-aI-o60"/>
|
||||
</connections>
|
||||
</tokenField>
|
||||
<tokenField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rzc-AK-4Vr">
|
||||
<rect key="frame" x="105" y="20" width="400" height="22"/>
|
||||
<tokenFieldCell key="cell" selectable="YES" editable="YES" borderStyle="bezel" alignment="left" drawsBackground="YES" allowsEditingTextAttributes="YES" id="aHe-D5-fgj">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</tokenFieldCell>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="mh9-CJ-zVx"/>
|
||||
</connections>
|
||||
</tokenField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dq1-e8-fa6">
|
||||
<rect key="frame" x="507" y="89" width="50" height="32"/>
|
||||
<buttonCell key="cell" type="push" bezelStyle="rounded" image="NSSmartBadgeTemplate" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="qsh-5h-jhl">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="showMovieTokens:" target="-2" id="Er8-nw-di4"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fZZ-im-9BI">
|
||||
<rect key="frame" x="507" y="13" width="50" height="32"/>
|
||||
<buttonCell key="cell" type="push" bezelStyle="rounded" image="NSSmartBadgeTemplate" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="gf3-DD-hW7">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="showTvShowTokens:" target="-2" id="pHZ-v7-U0W"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="rzc-AK-4Vr" firstAttribute="leading" secondItem="TBF-BD-fSk" secondAttribute="leading" constant="32" id="Aws-ML-M7P"/>
|
||||
<constraint firstItem="TBF-BD-fSk" firstAttribute="top" secondItem="i8H-oP-Sif" secondAttribute="bottom" constant="32" id="C0O-NO-8Te"/>
|
||||
<constraint firstItem="dq1-e8-fa6" firstAttribute="centerY" secondItem="i8H-oP-Sif" secondAttribute="centerY" id="Dsc-lq-HSw"/>
|
||||
<constraint firstItem="rzc-AK-4Vr" firstAttribute="top" secondItem="TBF-BD-fSk" secondAttribute="bottom" constant="8" id="FZZ-y5-ycJ"/>
|
||||
<constraint firstItem="PZS-8W-dno" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="GYO-gT-cbH"/>
|
||||
<constraint firstItem="i8H-oP-Sif" firstAttribute="top" secondItem="PZS-8W-dno" secondAttribute="bottom" constant="8" id="Mvi-1G-Dhn"/>
|
||||
<constraint firstItem="i8H-oP-Sif" firstAttribute="leading" secondItem="PZS-8W-dno" secondAttribute="leading" constant="32" id="ael-zI-oHU"/>
|
||||
<constraint firstItem="TBF-BD-fSk" firstAttribute="leading" secondItem="PZS-8W-dno" secondAttribute="leading" id="cyH-w2-B1O"/>
|
||||
<constraint firstItem="dq1-e8-fa6" firstAttribute="leading" secondItem="i8H-oP-Sif" secondAttribute="trailing" constant="8" id="dhO-Zz-g71"/>
|
||||
<constraint firstItem="fZZ-im-9BI" firstAttribute="centerY" secondItem="rzc-AK-4Vr" secondAttribute="centerY" id="gzL-hH-eGN"/>
|
||||
<constraint firstAttribute="bottom" secondItem="rzc-AK-4Vr" secondAttribute="bottom" constant="20" id="icu-JT-7hW"/>
|
||||
<constraint firstItem="fZZ-im-9BI" firstAttribute="leading" secondItem="rzc-AK-4Vr" secondAttribute="trailing" constant="8" id="kZg-YA-eMU"/>
|
||||
<constraint firstItem="i8H-oP-Sif" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="n4G-w8-dKr"/>
|
||||
<constraint firstItem="i8H-oP-Sif" firstAttribute="width" secondItem="rzc-AK-4Vr" secondAttribute="width" id="xG0-RB-Iyt"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-23" y="40"/>
|
||||
</customView>
|
||||
<userDefaultsController representsSharedInstance="YES" id="BZm-iR-6oK"/>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSSmartBadgeTemplate" width="14" height="14"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13770" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13770"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="TokensViewController" customModule="Subler" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="tokenField" destination="3eA-Oq-Zyv" id="xha-ZF-hFQ"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="400" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<tokenField verticalHuggingPriority="750" verticalCompressionResistancePriority="1000" preferredMaxLayoutWidth="400" translatesAutoresizingMaskIntoConstraints="NO" id="3eA-Oq-Zyv">
|
||||
<rect key="frame" x="-2" y="0.0" width="404" height="16"/>
|
||||
<tokenFieldCell key="cell" selectable="YES" alignment="left" allowsEditingTextAttributes="YES" id="hFL-Bt-Qm9">
|
||||
<font key="font" metaFont="cellTitle"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</tokenFieldCell>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="e7f-N6-4tr"/>
|
||||
</connections>
|
||||
</tokenField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="3eA-Oq-Zyv" secondAttribute="trailing" id="0zG-xK-JOF"/>
|
||||
<constraint firstItem="3eA-Oq-Zyv" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="FmQ-N7-tXP"/>
|
||||
<constraint firstItem="3eA-Oq-Zyv" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="HXi-hZ-PZh"/>
|
||||
<constraint firstAttribute="bottom" secondItem="3eA-Oq-Zyv" secondAttribute="bottom" id="Hg6-Lw-f3C"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="50" y="113"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// OutputPrefsViewController.swift
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 30/11/2017.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class OutputPrefsViewController: NSViewController, NSTokenFieldDelegate {
|
||||
|
||||
@IBOutlet var movieField: NSTokenField!
|
||||
@IBOutlet var tvShowField: NSTokenField!
|
||||
|
||||
var moviePopover: NSPopover?
|
||||
var tvShowPopover: NSPopover?
|
||||
|
||||
let separators: CharacterSet
|
||||
|
||||
override var nibName: NSNib.Name? {
|
||||
return NSNib.Name(rawValue: "OutputPrefsViewController")
|
||||
}
|
||||
|
||||
init() {
|
||||
self.separators = CharacterSet(charactersIn: "{}")
|
||||
super.init(nibName: self.nibName, bundle: nil)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func loadView() {
|
||||
super.loadView()
|
||||
|
||||
movieField.tokenizingCharacterSet = CharacterSet(charactersIn: "%")
|
||||
tvShowField.tokenizingCharacterSet = CharacterSet(charactersIn: "%")
|
||||
|
||||
if let movieFormat = UserDefaults.standard.string(forKey: "SBMovieFormat") {
|
||||
movieField.stringValue = movieFormat
|
||||
}
|
||||
if let tvShowFormat = UserDefaults.standard.string(forKey: "SBTVShowFormat") {
|
||||
tvShowField.stringValue = tvShowFormat
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Actions
|
||||
|
||||
@IBAction func showMovieTokens(_ sender: NSView) {
|
||||
if let popover = tvShowPopover {
|
||||
popover.close()
|
||||
tvShowPopover = nil
|
||||
}
|
||||
if let popover = moviePopover {
|
||||
popover.close()
|
||||
moviePopover = nil
|
||||
}
|
||||
else {
|
||||
moviePopover = showTokensPopover(tokens: MP42Metadata.writableMetadata, view: sender)
|
||||
}
|
||||
}
|
||||
|
||||
@IBAction func showTvShowTokens(_ sender: NSView) {
|
||||
if let popover = moviePopover {
|
||||
popover.close()
|
||||
moviePopover = nil
|
||||
}
|
||||
if let popover = tvShowPopover {
|
||||
popover.close()
|
||||
tvShowPopover = nil
|
||||
}
|
||||
else {
|
||||
tvShowPopover = showTokensPopover(tokens: MP42Metadata.writableMetadata, view: sender)
|
||||
}
|
||||
}
|
||||
|
||||
private func showTokensPopover(tokens: [String], view: NSView) -> NSPopover {
|
||||
let tokensController = TokensViewController(tokens: tokens)
|
||||
let p = NSPopover()
|
||||
p.contentViewController = tokensController
|
||||
p.show(relativeTo: view.bounds, of: view, preferredEdge: NSRectEdge.maxY)
|
||||
return p
|
||||
}
|
||||
|
||||
// MARK: Format Token Field Delegate
|
||||
|
||||
override func controlTextDidEndEditing(_ obj: Notification) {
|
||||
|
||||
}
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, displayStringForRepresentedObject representedObject: Any) -> String? {
|
||||
if let stringValue = representedObject as? String, stringValue.hasPrefix("{") {
|
||||
return localizedMetadataKeyName(stringValue.trimmingCharacters(in: separators))
|
||||
}
|
||||
return representedObject as? String
|
||||
}
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, styleForRepresentedObject representedObject: Any) -> NSTokenField.TokenStyle {
|
||||
if let stringValue = representedObject as? String, stringValue.hasPrefix("{") {
|
||||
return .rounded
|
||||
}
|
||||
else {
|
||||
return .none
|
||||
}
|
||||
}
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, representedObjectForEditing editingString: String) -> Any? {
|
||||
// Disable whitespace-trimming
|
||||
return editingString
|
||||
}
|
||||
|
||||
// func tokenField(_ tokenField: NSTokenField, completionsForSubstring substring: String, indexOfToken tokenIndex: Int, indexOfSelectedItem selectedIndex: UnsafeMutablePointer<Int>?) -> [Any]? {
|
||||
// matches = currentTokens.filter { $0.hasPrefix(substring) }
|
||||
// return matches
|
||||
//
|
||||
// }
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, editingStringForRepresentedObject representedObject: Any) -> String? {
|
||||
if let stringValue = representedObject as? String, stringValue.hasPrefix("{") {
|
||||
return "%\(stringValue)%"
|
||||
}
|
||||
return representedObject as? String
|
||||
}
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, shouldAdd tokens: [Any], at index: Int) -> [Any] {
|
||||
return tokens
|
||||
}
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, writeRepresentedObjects objects: [Any], to pboard: NSPasteboard) -> Bool {
|
||||
if let strings = objects as? [String] {
|
||||
let string = strings.reduce("", { "\($0)%\($1)" })
|
||||
pboard.setString(string, forType: NSPasteboard.PasteboardType.string)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,6 +38,11 @@ import Cocoa
|
||||
"chaptersPreviewTrack": true,
|
||||
"SBChaptersPreviewPosition": 0.5,
|
||||
|
||||
"SBMovieFormat": "%{Name}",
|
||||
"SBTVShowFormat": "%{TV Show}% s%{TV Season}%e%{TV Episode #}",
|
||||
"SBSetMovieFormat": false,
|
||||
"SBSetTVShowFormat": false,
|
||||
|
||||
"SBMetadataPreference|Movie": "TheMovieDB",
|
||||
"SBMetadataPreference|Movie|iTunes Store|Language": "USA (English)",
|
||||
"SBMetadataPreference|Movie|TheMovieDB|Language": "en",
|
||||
@@ -61,10 +66,12 @@ import Cocoa
|
||||
|
||||
let metadataController: MetadataPrefsViewController
|
||||
let presetController: PresetPrefsViewController
|
||||
let outputController: OutputPrefsViewController
|
||||
|
||||
let general: NSToolbarItem.Identifier
|
||||
let metadata: NSToolbarItem.Identifier
|
||||
let presets: NSToolbarItem.Identifier
|
||||
let output: NSToolbarItem.Identifier
|
||||
let advanced: NSToolbarItem.Identifier
|
||||
|
||||
override var windowNibName: NSNib.Name? {
|
||||
@@ -74,10 +81,12 @@ import Cocoa
|
||||
init() {
|
||||
self.metadataController = MetadataPrefsViewController()
|
||||
self.presetController = PresetPrefsViewController()
|
||||
self.outputController = OutputPrefsViewController()
|
||||
|
||||
self.general = NSToolbarItem.Identifier("TOOLBAR_GENERAL")
|
||||
self.metadata = NSToolbarItem.Identifier("TOOLBAR_METADATA")
|
||||
self.presets = NSToolbarItem.Identifier("TOOLBAR_SETS")
|
||||
self.output = NSToolbarItem.Identifier("TOOLBAR_OUTPUT")
|
||||
self.advanced = NSToolbarItem.Identifier("TOOLBAR_ADVANCED")
|
||||
|
||||
super.init(window: nil)
|
||||
@@ -104,6 +113,7 @@ import Cocoa
|
||||
if identifier == general { return generalView }
|
||||
if identifier == metadata { return metadataController.view }
|
||||
if identifier == presets { return presetController.view }
|
||||
if identifier == output { return outputController.view }
|
||||
if identifier == advanced { return advancedView }
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// TokensViewController.swift
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 01/12/2017.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class TokensViewController: NSViewController, NSTokenFieldDelegate {
|
||||
|
||||
@IBOutlet var tokenField: NSTokenField!
|
||||
let tokens: [String]
|
||||
let separators: CharacterSet
|
||||
|
||||
override var nibName: NSNib.Name? {
|
||||
return NSNib.Name(rawValue: "TokensViewController")
|
||||
}
|
||||
|
||||
init(tokens: [String]) {
|
||||
self.tokens = tokens
|
||||
self.separators = CharacterSet(charactersIn: "{}")
|
||||
super.init(nibName: self.nibName, bundle: nil)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func loadView() {
|
||||
super.loadView()
|
||||
|
||||
tokenField.tokenizingCharacterSet = CharacterSet(charactersIn: "%")
|
||||
tokenField.stringValue = tokens.reduce("", { "\($0)%{\($1)}" })
|
||||
}
|
||||
|
||||
// MARK: Format Token Field Delegate
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, displayStringForRepresentedObject representedObject: Any) -> String? {
|
||||
if let stringValue = representedObject as? String, stringValue.hasPrefix("{") {
|
||||
return localizedMetadataKeyName(stringValue.trimmingCharacters(in: separators))
|
||||
}
|
||||
return representedObject as? String
|
||||
}
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, styleForRepresentedObject representedObject: Any) -> NSTokenField.TokenStyle {
|
||||
if let stringValue = representedObject as? String, stringValue.hasPrefix("{") {
|
||||
return .rounded
|
||||
}
|
||||
else {
|
||||
return .none
|
||||
}
|
||||
}
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, editingStringForRepresentedObject representedObject: Any) -> String? {
|
||||
if let stringValue = representedObject as? String, stringValue.hasPrefix("{") {
|
||||
return "%\(stringValue)%"
|
||||
}
|
||||
return representedObject as? String
|
||||
}
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, shouldAdd tokens: [Any], at index: Int) -> [Any] {
|
||||
return tokens
|
||||
}
|
||||
|
||||
func tokenField(_ tokenField: NSTokenField, writeRepresentedObjects objects: [Any], to pboard: NSPasteboard) -> Bool {
|
||||
if let strings = objects as? [String] {
|
||||
let string = strings.reduce("", { "\($0)%\($1)" })
|
||||
pboard.setString(string, forType: NSPasteboard.PasteboardType.string)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user