Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ on:
jobs:
textgrabber2:
name: TextGrabber2
runs-on: macos-26
runs-on: xcode-27
Comment thread
cyanzhong marked this conversation as resolved.
if: github.event.pull_request.draft == false
env:
DEVELOPER_DIR: /Applications/Xcode_26.6.app/Contents/Developer

steps:
- uses: actions/checkout@v5
- name: Build TextGrabber2
run: |
xcodebuild build -scheme TextGrabber2 -destination 'platform=macOS' CODE_SIGN_IDENTITY="" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO
xcodebuild build -scheme TextGrabber2 -destination 'generic/platform=macOS' CODE_SIGN_IDENTITY="" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO
2 changes: 1 addition & 1 deletion BuildTools/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PackageDescription
let package = Package(
name: "BuildTools",
platforms: [
.macOS(.v15),
.macOS("26.0"),
],
products: [
.plugin(name: "SwiftLint", targets: ["SwiftLint"]),
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# TextGrabber2

[![](https://img.shields.io/badge/Platform-macOS_15.0+-blue?color=007bff)](https://github.com/TextGrabber2-app/TextGrabber2/releases/latest) [![](https://github.com/TextGrabber2-app/TextGrabber2/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/TextGrabber2-app/TextGrabber2/actions/workflows/build.yml)
[![](https://img.shields.io/badge/Platform-macOS_26.0+-blue?color=007bff)](https://github.com/TextGrabber2-app/TextGrabber2/releases/latest) [![](https://github.com/TextGrabber2-app/TextGrabber2/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/TextGrabber2-app/TextGrabber2/actions/workflows/build.yml)

TextGrabber2 is a free and **open-source** “Copy-to-Action” tool that lets you [extract text](https://github.com/TextGrabber2-app/TextGrabber2/wiki#capture-screen-on-mac) from copied images and seamlessly [run actions](https://github.com/TextGrabber2-app/TextGrabber2/wiki#connect-to-system-services).

Expand All @@ -30,7 +30,7 @@ See the [wiki](https://github.com/TextGrabber2-app/TextGrabber2/wiki) for more d

> [!NOTE]
>
> For information on clipboard access issues in macOS 15.4 and later, please refer to our [wiki](https://github.com/TextGrabber2-app/TextGrabber2/wiki#limited-access).
> For information on clipboard access restrictions, please refer to our [wiki](https://github.com/TextGrabber2-app/TextGrabber2/wiki#limited-access).

## Installation

Expand Down
6 changes: 3 additions & 3 deletions TextGrabber2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1530;
LastUpgradeCheck = 2620;
LastUpgradeCheck = 2700;
TargetAttributes = {
87E192BE2BAADE1200A87A4E = {
CreatedOnToolsVersion = 15.3;
Expand Down Expand Up @@ -242,7 +242,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -307,7 +307,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MACOSX_DEPLOYMENT_TARGET = 15.0;
MACOSX_DEPLOYMENT_TARGET = 26.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2620"
LastUpgradeVersion = "2700"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2620"
LastUpgradeVersion = "2700"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2620"
LastUpgradeVersion = "2700"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
9 changes: 1 addition & 8 deletions TextGrabber2/Sources/App/App+Detection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,7 @@ private extension App {
let item = ResultItem(title: candidate.text.singleLine.truncatedToFit(width: 320, font: .menuFont(ofSize: 0)))
menu.insertItem(item, at: menu.index(of: separator) + 1)

if #available(macOS 26.0, *) {
// Rely on the system design
item.image = NSImage(systemSymbolName: candidate.icon, accessibilityDescription: nil)
} else {
// Use a smaller size on purpose to look better
item.image = .with(symbolName: candidate.icon, pointSize: 11.0)
}

item.image = NSImage(systemSymbolName: candidate.icon, accessibilityDescription: nil)
item.ensureImageVisibility()
item.addAction { [weak self] in
NSPasteboard.general.string = candidate.text
Expand Down
12 changes: 0 additions & 12 deletions TextGrabber2/Sources/Extensions/NSMenuItem+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,7 @@ extension NSMenuItem {
return
}

#if canImport(FoundationModels, _version: 2)
preferredImageVisibility = .visible
#else
let selector = sel_getUid("setPreferredImageVisibility:")
if responds(to: selector) {
unsafeBitCast(
method(for: selector),
to: (@convention(c) (NSMenuItem, Selector, Int) -> Void).self
)(self, selector, 1) // .visible
} else {
assertionFailure("Missing setPreferredImageVisibility:")
}
#endif
}

@MainActor
Expand Down
6 changes: 1 addition & 5 deletions TextGrabber2/Sources/Extensions/NSPasteboard+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ extension NSPasteboard {
}

var hasLimitedAccess: Bool {
guard #available(macOS 15.4, *) else {
return false
}

return accessBehavior != .alwaysAllow
accessBehavior != .alwaysAllow
}

var hasFullAccess: Bool {
Expand Down