Skip to content

Commit

Permalink
Removed features to import from iPhone and recognize with camera.
Browse files Browse the repository at this point in the history
  • Loading branch information
chigkim committed Apr 8, 2020
1 parent c5b035e commit 3fe1695
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 351 deletions.
12 changes: 2 additions & 10 deletions VOCR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@
EA5C7AC82351B3F500D84042 /* OCR.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5C7AC72351B3F500D84042 /* OCR.swift */; };
EA5C7ACA2351B96D00D84042 /* Take Screenshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5C7AC92351B96D00D84042 /* Take Screenshot.swift */; };
EA5C7ACC2351BB6D00D84042 /* Navigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5C7ACB2351BB6D00D84042 /* Navigation.swift */; };
EA5C7ACE2351C10100D84042 /* MacCamera.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5C7ACD2351C10100D84042 /* MacCamera.swift */; };
EA5C7AD02351C8DE00D84042 /* AXUIElement Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5C7ACF2351C8DE00D84042 /* AXUIElement Extension.swift */; };
EA5C7AD42351D44B00D84042 /* RecognizeVOCursor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA5C7AD32351D44B00D84042 /* RecognizeVOCursor.swift */; };
EA5C7AD92351D81100D84042 /* VOScreenshot.scpt in Resources */ = {isa = PBXBuildFile; fileRef = EA5C7AD82351D81100D84042 /* VOScreenshot.scpt */; };
EA688D452355BDC500F722C7 /* Bundle Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA688D442355BDC500F722C7 /* Bundle Extension.swift */; };
EA6C26AC2354656D00665D4D /* Classifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA6C26AB2354656D00665D4D /* Classifier.swift */; };
EA76243F243C5576001D665D /* ImportViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA76243E243C5576001D665D /* ImportViewController.swift */; };
EA8AD6412352B4A000D26871 /* Double Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA8AD6402352B4A000D26871 /* Double Extension.swift */; };
EAA12C4F234C89030036AF6A /* NavigationShortcuts.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA12C4E234C89030036AF6A /* NavigationShortcuts.swift */; };
EAD9CFD22355E11600E7F594 /* say.scpt in Resources */ = {isa = PBXBuildFile; fileRef = EAD9CFD12355E11600E7F594 /* say.scpt */; };
Expand Down Expand Up @@ -96,13 +94,11 @@
EA5C7AC72351B3F500D84042 /* OCR.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OCR.swift; sourceTree = "<group>"; };
EA5C7AC92351B96D00D84042 /* Take Screenshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Take Screenshot.swift"; sourceTree = "<group>"; };
EA5C7ACB2351BB6D00D84042 /* Navigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Navigation.swift; sourceTree = "<group>"; };
EA5C7ACD2351C10100D84042 /* MacCamera.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacCamera.swift; sourceTree = "<group>"; };
EA5C7ACF2351C8DE00D84042 /* AXUIElement Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AXUIElement Extension.swift"; sourceTree = "<group>"; };
EA5C7AD32351D44B00D84042 /* RecognizeVOCursor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecognizeVOCursor.swift; sourceTree = "<group>"; };
EA5C7AD82351D81100D84042 /* VOScreenshot.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = VOScreenshot.scpt; sourceTree = "<group>"; };
EA688D442355BDC500F722C7 /* Bundle Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle Extension.swift"; sourceTree = "<group>"; };
EA6C26AB2354656D00665D4D /* Classifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Classifier.swift; sourceTree = "<group>"; };
EA76243E243C5576001D665D /* ImportViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImportViewController.swift; sourceTree = "<group>"; };
EA8AD6402352B4A000D26871 /* Double Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Double Extension.swift"; sourceTree = "<group>"; };
EAA12C4E234C89030036AF6A /* NavigationShortcuts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationShortcuts.swift; sourceTree = "<group>"; };
EAD9CFD12355E11600E7F594 /* say.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = say.scpt; sourceTree = "<group>"; };
Expand Down Expand Up @@ -262,9 +258,7 @@
EA688D442355BDC500F722C7 /* Bundle Extension.swift */,
EA6C26AB2354656D00665D4D /* Classifier.swift */,
EA8AD6402352B4A000D26871 /* Double Extension.swift */,
EA76243E243C5576001D665D /* ImportViewController.swift */,
EADE59BD232EB09A00E2F65A /* Info.plist */,
EA5C7ACD2351C10100D84042 /* MacCamera.swift */,
EADE59BA232EB09A00E2F65A /* Main.storyboard */,
EA5C7ACB2351BB6D00D84042 /* Navigation.swift */,
EAA12C4E234C89030036AF6A /* NavigationShortcuts.swift */,
Expand Down Expand Up @@ -359,7 +353,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EA5C7ACE2351C10100D84042 /* MacCamera.swift in Sources */,
EADE59B7232EB09A00E2F65A /* AboutViewController.swift in Sources */,
EA5C7ACA2351B96D00D84042 /* Take Screenshot.swift in Sources */,
EA8AD6412352B4A000D26871 /* Double Extension.swift in Sources */,
Expand All @@ -376,7 +369,6 @@
EA5C7AD42351D44B00D84042 /* RecognizeVOCursor.swift in Sources */,
EA2DA1AD232EB1D600D31031 /* Accessibility.swift in Sources */,
EA5C7ACC2351BB6D00D84042 /* Navigation.swift in Sources */,
EA76243F243C5576001D665D /* ImportViewController.swift in Sources */,
EA6C26AC2354656D00665D4D /* Classifier.swift in Sources */,
EA2DA1A9232EB18800D31031 /* HotKey.swift in Sources */,
EAF9C3C82354A66200D4D77C /* Settings.swift in Sources */,
Expand Down Expand Up @@ -530,7 +522,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 9N598S2535;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -557,7 +549,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 9N598S2535;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
11 changes: 9 additions & 2 deletions VOCR/Accessibility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ class Accessibility {

static let speech:NSSpeechSynthesizer = NSSpeechSynthesizer()


static func isTrusted(ask:Bool) -> Bool {
let prompt = kAXTrustedCheckOptionPrompt.takeUnretainedValue() as NSString
let prompt = kAXTrustedCheckOptionPrompt.takeUnretainedValue() as NSString
let options = [prompt: ask]
return AXIsProcessTrustedWithOptions(options as CFDictionary?)
}
Expand All @@ -25,8 +26,14 @@ class Accessibility {
NSAccessibility.post(element:element, notification: NSAccessibility.Notification.announcementRequested, userInfo: announcement)
}

static func speakWithSynthesizer(_ message:String) {
DispatchQueue.global().async {
speech.startSpeaking(message)
}
}

static func speak(_ message:String) {
// speech.startSpeaking(message)

let bundle = Bundle.main
let url = bundle.url(forResource: "say", withExtension: "scpt")
let parameters = NSAppleEventDescriptor.list()
Expand Down
114 changes: 1 addition & 113 deletions VOCR/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="200" height="100"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<connections>
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
</connections>
Expand Down Expand Up @@ -741,117 +741,5 @@
</objects>
<point key="canvasLocation" x="75" y="655"/>
</scene>
<!--ImportWindow isController-->
<scene sceneID="u4h-y5-l4x">
<objects>
<windowController storyboardIdentifier="importWindowStoryboardID" id="KeO-wv-ktK" userLabel="ImportWindow isController" sceneMemberID="viewController">
<window key="window" title="Import" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="5Pd-yp-sN3">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="425" y="461" width="1920" height="1080"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<connections>
<outlet property="delegate" destination="KeO-wv-ktK" id="hxS-Vg-atc"/>
</connections>
</window>
<connections>
<segue destination="Zxf-RL-f8l" kind="relationship" relationship="window.shadowedContentViewController" id="4WW-lY-DcQ"/>
</connections>
</windowController>
<customObject id="o1g-xW-Kz1" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-295" y="996"/>
</scene>
<!--ImportView Controller-->
<scene sceneID="Q7P-dy-ovY">
<objects>
<viewController id="Zxf-RL-f8l" userLabel="ImportView Controller" customClass="ImportViewController" customModule="VOCR" sceneMemberID="viewController">
<view key="view" id="eM3-hz-8KU">
<rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView distribution="fillEqually" orientation="horizontal" alignment="top" spacing="0.0" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" translatesAutoresizingMaskIntoConstraints="NO" id="TU5-6m-RGo">
<rect key="frame" x="0.0" y="0.0" width="1920" height="1607"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="OXb-zs-RgR">
<rect key="frame" x="0.0" y="0.0" width="960" height="1607"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="eoY-Gt-4WR"/>
<accessibility description="Source"/>
</imageView>
<scrollView borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jmo-N5-RKo">
<rect key="frame" x="960" y="0.0" width="960" height="1607"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="Aio-97-6PC">
<rect key="frame" x="0.0" y="0.0" width="960" height="1607"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" spellingCorrection="YES" smartInsertDelete="YES" id="zI7-Aj-k4g">
<rect key="frame" x="0.0" y="0.0" width="960" height="1607"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="960" height="1607"/>
<size key="maxSize" width="960" height="10000000"/>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
</textView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="aQF-KT-2Ih">
<rect key="frame" x="-100" y="-100" width="240" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="6KL-iB-d8h">
<rect key="frame" x="944" y="0.0" width="16" height="1607"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
</subviews>
<constraints>
<constraint firstItem="jmo-N5-RKo" firstAttribute="leading" secondItem="TU5-6m-RGo" secondAttribute="centerX" id="Jnj-CF-Ttg"/>
<constraint firstItem="jmo-N5-RKo" firstAttribute="bottom" secondItem="TU5-6m-RGo" secondAttribute="bottom" id="Ru9-id-OoJ"/>
<constraint firstItem="jmo-N5-RKo" firstAttribute="top" secondItem="TU5-6m-RGo" secondAttribute="top" id="Wqe-F4-L1l"/>
<constraint firstItem="jmo-N5-RKo" firstAttribute="trailing" secondItem="TU5-6m-RGo" secondAttribute="trailing" id="c7h-NQ-g8w"/>
<constraint firstItem="OXb-zs-RgR" firstAttribute="bottom" secondItem="TU5-6m-RGo" secondAttribute="bottom" id="cHk-FM-SAU"/>
<constraint firstItem="OXb-zs-RgR" firstAttribute="trailing" secondItem="TU5-6m-RGo" secondAttribute="centerX" id="nfD-99-yCl"/>
<constraint firstItem="OXb-zs-RgR" firstAttribute="top" secondItem="TU5-6m-RGo" secondAttribute="top" id="ouA-2I-adC"/>
<constraint firstItem="OXb-zs-RgR" firstAttribute="leading" secondItem="TU5-6m-RGo" secondAttribute="leading" id="pNc-94-JA9"/>
</constraints>
<visibilityPriorities>
<integer value="1000"/>
<integer value="1000"/>
</visibilityPriorities>
<customSpacing>
<real value="3.4028234663852886e+38"/>
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DPR-2p-GQ3">
<rect key="frame" x="919" y="1600" width="83" height="32"/>
<buttonCell key="cell" type="push" title="Source" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Uhl-5A-Gnw">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="chooseSource:" target="Zxf-RL-f8l" id="I0w-4a-b72"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="DPR-2p-GQ3" firstAttribute="centerX" secondItem="eM3-hz-8KU" secondAttribute="centerX" id="KKQ-SZ-VmS"/>
<constraint firstItem="TU5-6m-RGo" firstAttribute="trailing" secondItem="eM3-hz-8KU" secondAttribute="trailing" id="Y2Y-Yx-fh7"/>
<constraint firstItem="TU5-6m-RGo" firstAttribute="top" secondItem="DPR-2p-GQ3" secondAttribute="bottom" id="hFJ-M7-UK8"/>
<constraint firstItem="DPR-2p-GQ3" firstAttribute="top" secondItem="eM3-hz-8KU" secondAttribute="top" id="mn5-wf-gdK"/>
<constraint firstItem="TU5-6m-RGo" firstAttribute="leading" secondItem="eM3-hz-8KU" secondAttribute="leading" id="tjU-di-TtZ"/>
<constraint firstItem="TU5-6m-RGo" firstAttribute="bottom" secondItem="eM3-hz-8KU" secondAttribute="bottom" id="wsZ-KH-Khw"/>
</constraints>
</view>
<connections>
<outlet property="imageView" destination="OXb-zs-RgR" id="JPI-Cv-sRy"/>
<outlet property="textView" destination="zI7-Aj-k4g" id="NiM-cJ-N8W"/>
</connections>
</viewController>
<customObject id="PC0-kQ-lfk" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-295" y="978"/>
</scene>
</scenes>
</document>
Loading

0 comments on commit 3fe1695

Please sign in to comment.