• Stars
    star
    303
  • Rank 134,373 (Top 3 %)
  • Language
  • Created about 1 year ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Apple Shortcut for sharing text to ChatGPT using personalized prompts

Share to ChatGPT Shortcut

Share to ChatGPT is an Apple Shortcut that allows users to share highlighted text to ChatGPT while also including personalized prompts, the response message will automatically be copied to the user's clipboard.

Installation

The shortcut is released on RoutineHub, you can install it from there:

https://routinehub.co/shortcut/14636/

Or install from the direct link on iCloud:

https://www.icloud.com/shortcuts/25262952f34544e99b9e6678056c1168

While installing, the shortcut will ask you to enter your OpenAI API key. If you don't have one, you can get it from the OpenAI dashboard.

Usage

After installation, the shortcut will be available in the Shortcuts app. Follow the steps below to initialize the shortcut:

  1. Open the shortcut
  2. Type something like "hello" for testing purpose, and choose a built-in prompt like "chat".
  3. Click "Allow" for every confirmation dialog.
Step 1 Step 2 Step 3

To create an easily accessible shortcut for daily use, follow these steps:

  1. Open the share sheet by highlighting some text and tapping the share button.
  2. Scroll to the bottom and select "Edit Actions".
  3. Scroll to the bottom again and choose "Share to ChatGPT".
  4. This will place the shortcut at the top of the share sheet for easy access.
Step 1 Step 2 Step 3 Step 4

Finally, let's see how to use the shortcut in action. Here's an example to use the shortcut to revise a sentence:

  1. Highlight the text and click "Share" in the tooltip
  2. Click "Share to ChatGPT" in the share sheet
  3. Choose "revise" in the dialog
  4. Preview the result, which has already been copied to the clipboard
Step 1 Step 2 Step 3 Step 4

Accessibility

Keyboard Shortcut

On MacOS, you can set a global keyboard shortcut to run this shortcut. To do this, open the "Keyboard" preference pane, select "Shortcuts", select "Services" on the left, and then select "Share to ChatGPT" in the "Shortcuts" section. You can then set a keyboard shortcut for it.

iPhone Back Tap

Run this shortcut by tapping the back of your iPhone: 1. On your iPhone, go to Settings > Accessibility > Touch. 2. Scroll down, then select Back Tap. 3. Select either Double Tap or Triple Tap. 4. Scroll down to the Shortcuts area, then choose Rephrase With GPT.

Tap Back Tap to apply the setting.

Prompts

The shortcut has the following built-in prompts.

Prompt Content
revise Revise the following sentences to make them more clear concise and coherent
summarize Summarize the following text
translate Translate the following text to English
chat -

The message sent to ChatGPT is generated by concatenating the prompt and the shared text. For example if you choose the "revise" prompt and share the text "nice to see you", the message will be:

Revise the following sentences to make them more clear concise and coherent:

nice to see you

Please note that the chat prompt is a special prompt that is empty. It will directly pass the shared text without modification.

You can also add your own prompts by editing the shortcut.

Configuration

The configuration is stored in the shortcut, you can change them by clicking the "…" sign of this shortcut in the Shortcuts app, and then click the ⓘ symbol at the bottom of the screen, and then click "Customize Shortcut" to open the configuration dialog.

Here's the meaning of each configuration item:

  • API-key: Your OpenAI API key
  • API-base-url: The base URL of the API endpoint. By default it's https://api.openai.com/v1/. You can change it to use a different API endpoint if you understand this setting.
  • model: The model to use for ChatGPT API. By default it's gpt-3.5-turbo. For a complete list see models of /v1/chat/completions in Model endpoint compatibility.
  • history-file: The file name to store messages history. The history file path would be iCloud Drive/Shortcuts/Share-to-ChatGPT/$date/$history-file. If omitted, messages will not be recorded.

Changelog

  • 1.0.0 - Initial release.
  • 1.0.1 - Fix a bug that the shortcut cannot determine empty user input properly.
  • 1.0.2 - Enhance error output.
  • 1.1.0
    • Store configuration in the shortcut setup by utilizing the "Import Questions" feature. No config file anymore.
    • Add message history support. When history file name is set, the shortcut will record messages in the history file.
  • 1.2.0 - Add model configuration item.

Credits

  • This project was inspired by ChatGPT-Siri and it provided me with valuable assistance while working with Shortcuts.app's editor.
  • Rephrase With GPT is a similar shortcut focuses on rephrasing text. It's a great shortcut and I highly recommend it.

More Repositories

1

awesome-chatgpt-api

Curated list of apps and tools that not only use the new ChatGPT API, but also allow users to configure their own API keys, enabling free and on-demand usage of their own quota.
Python
5,617
star
2

httpstat

curl statistics made simple
Python
5,588
star
3

sui2

a startpage for your server and / or new tab page
JavaScript
391
star
4

jsoncv

A toolkit for building your CV with JSON and creating stylish HTML/PDF files.
JavaScript
249
star
5

obsidian-paste-image-rename

Renames pasted images and all the other attachments added to the vault
TypeScript
234
star
6

cht-colors

Chinese Traditional Colors
HTML
216
star
7

ai.py

A single-file Python script that interacts with ChatGPT API in the command-line.
Python
114
star
8

python-terminal-color

Drop-in single file library for printing color in terminal
Python
69
star
9

torext

[WORKING ON] The missing tornado mate
Python
61
star
10

minimal-bilibili

给你纯净的 Bilibili 视频发现体验
TypeScript
60
star
11

xiami_exporter

Export your data from Xiami
JavaScript
59
star
12

github-toc-sidebar

Show GitHub Readme TOC as a sidebar
TypeScript
44
star
13

n8n-workflows

My workflows for n8n automation
Python
38
star
14

obsidian-people-link

Easily create links to people within your documents.
TypeScript
37
star
15

obsidian-telegraph-publish

Publish your Obsidian note to a Telegraph page.
TypeScript
36
star
16

refgen

JavaScript
34
star
17

flomo-to-obsidian

JavaScript
30
star
18

cx-extractor

Automatically exported from code.google.com/p/cx-extractor
HTML
29
star
19

autotagger

Tag .mp3 and .m4a audio files from iTunes data automatically.
Python
28
star
20

substance

Extract substance from the web
HTML
23
star
21

obsidian-daily-notes-opener

Easily open daily notes and periodic notes in new pane; customize periodic notes background; quick append new line to daily notes.
TypeScript
21
star
22

project_sketch

A nerd's boilerplate for your Python project.
Python
20
star
23

readability

html main body extractor
HTML
17
star
24

dotfiles

my rcs
Vim Script
15
star
25

deptest

dependent testing framework
Python
15
star
26

chatroom

simple chatroom using tornado long polling feature
JavaScript
14
star
27

rdl

Redis dump & load tool.
Python
12
star
28

squared

JavaScript
11
star
29

simplemongo

A Simple & Clear MongoDB ORM
Python
9
star
30

ts

Twitter Search CLI
Python
9
star
31

xiamifav

xiami html5 client
JavaScript
7
star
32

miniflux-on-railway

miniflux deployed on railway.app
Python
7
star
33

drawtable

Draw ASCII art box with text.
Python
7
star
34

getenv

Environment variable definition with type
Python
7
star
35

userscripts

My UserScripts
JavaScript
7
star
36

blog

HTML
6
star
37

params

A Python package that does better in request parameters validation than django.forms, wtforms, web_args or so.
Python
6
star
38

n8n-on-railway

Shell
6
star
39

eurasia

Automatically exported from code.google.com/p/eurasia
Python
5
star
40

things-to-ticktick

Export tasks from Things.app to TickTick format
Shell
5
star
41

pyconv

Text file code conversion tool
Python
4
star
42

dbflip

flip reading for douban note
JavaScript
4
star
43

beatles

Data and tools to enjoy The Beatles better.
Python
4
star
44

rss-filter

Modify and regenerate RSS source piped in
TypeScript
4
star
45

V2EXWitch

Chrome Extension - V2EX Account Switcher & Notifier
JavaScript
3
star
46

python-playground

Python
3
star
47

scripts

miscellaneous scripts I use
Shell
3
star
48

litekv

Simple kv store for Python
Python
3
star
49

cv

My CV site.
JavaScript
3
star
50

window-opener

TypeScript
3
star
51

pex_uwsgi_demo

Python
3
star
52

json_include

An extension for JSON to support file including
Python
3
star
53

feishu-exporter

Export Feishu docs with ease
JavaScript
3
star
54

fuload

Automatically exported from code.google.com/p/fuload
C++
2
star
55

gouken

Go microservice framework built on top of grpc
Go
2
star
56

aima-python

Automatically exported from code.google.com/p/aima-python
Python
2
star
57

django_starter_pack

My personal starter pack for Django projects
Python
2
star
58

learn_applescript

Notes & code pieces recorded during my exploration to AppleScript.
AppleScript
2
star
59

minireact

A minimal react project boilerplate
JavaScript
2
star
60

stexplorer

Download songs from SongTaste
Python
2
star
61

gopkg_opml

Python
1
star
62

qdan-archives

my archives on qdan.me
CSS
1
star
63

papermodx-example

HTML
1
star
64

rime_dict

Tools for manipulating userdict of rime input method
Python
1
star
65

pinback

Pinboard backup tool
Python
1
star
66

apibox

[WORKING ON] Building blocks for HTTP API development
Python
1
star
67

learn_spider

Practicing code to learn to write a spider
Python
1
star
68

whuspec

My graduation project.
HTML
1
star
69

obsidian-chatgpt

TypeScript
1
star
70

go-to-douban

I am Xiao Meng, and I want to work in Douban, I create this repository for announcing and yelling
1
star
71

start

Shell
1
star
72

python-installer

Shell
1
star
73

printable-css

HTML
1
star
74

kindle_ebook_template

for publishing kindle ebook - specially for chinese
1
star
75

pinyindep

essentials for implement pinyin transforming capability in your projects with python
Python
1
star
76

quiverweb

Web service for Quiver note app
Python
1
star
77

gatsby-starter-netlify-cms

JavaScript
1
star
78

alfred-workflows

my alfred workflows
Python
1
star
79

awesome-javascript-editors

A collection of awesome javascript editors
1
star
80

torext-admin

Python
1
star
81

html-cutter

A Chrome extension to cut out HTML fragments from a page.
JavaScript
1
star
82

simplate

Created with CodeSandbox
JavaScript
1
star
83

tomorrow

A new task scheduler, aimed at quick, clean, and clear
1
star
84

webpack-chrome-boilerplate

A boilerplate for building Chrome extensions with Webpack
TypeScript
1
star
85

SMU-MScCDA-ProgrammingTest-2023

Python
1
star
86

nasdaqtrader-rss

Python
1
star
87

n8n-on-fly

1
star
88

proto-typist

generate proto code from proto code
Python
1
star
89

project-nowhere

Automatically exported from code.google.com/p/project-nowhere
PHP
1
star