Accepts
WFAppContentItem, App Store Apps, Contacts, Dates, Email Addresses, iTunes Products, Phone Numbers, Safari Web Pages, Text, URLs, Locations, Map Links and Articles
SHARING
Copy
Shortcut Input
to clipboard
COMMENT
DISCLAIMER:
This shortcut does save any information that you allow it to see in a text file on iCloud. This shortcut does not save everything you copy; it does save the very last thing you copied if you run the shortcut. BE CAREFUL WITH WHAT YOU COPY BEFORE USING THIS SHORTCUT. If you copied something that you do not want saved to a text file, then PLEASE run the Clip History shortcut and select “Clear History”.
I’m not sure about the privacy implications of saving your clipboard to a text file, but you have been warned.
SETUP:
1) Run this shortcut first otherwise Clip History will result in an error.
2) This shortcut requires iOS 17.
3) Adding both shortcuts to your homescreen or control center (iOS 18) is suggested for better utilization.
4) If you are using this shortcut on iPadOS with an external keyboard or MacOS, I’d reccommend adding this as cmd+shift+C, or another keyboard shortcut.
Hopefully you find this as useful as I do,
- Brandon
TEXT
Text

Text
SCRIPTING
If
Text
is not
42
SCRIPTING
Show alert
You have not accepted the Terms and Conditions
Title
You have not accepted the Terms and Conditions
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
SCRIPTING
If
Clipboard
does not have any value
SCRIPTING
Ask
Nothing Copied to Clipboard. Add Something?

Provided Input
SHARING
Copy
Ask for Input
to clipboard
SCRIPTING
End If

If Result
MISSING
file.getfoldercontents Under Construction
SCRIPTING
If
Get Contents of Folder
does not contain
Clip History
DOCUMENTS
Create Folder
Path
/Shortcuts/Clip History
SCRIPTING
End If

If Result
MISSING
file.getfoldercontents Under Construction
SCRIPTING
If
Get Contents of Folder
does not contain
Clip History
DOCUMENTS
Prepend
Clipboard
File Path
Clip History.txt

Appended File
DOCUMENTS
Save
Appended File
Destination Path
/Shortcuts/Clip History.txtOverwrite If File Exists

Saved File
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
COMMENT
Above ensures the file exists. Below starts the magic.
MISSING
file Under Construction
TEXT
Split
File
by
New Lines

Split Text
SCRIPTING
Get
First Item
from
OG split text

Item from List
SCRIPTING
If
Clipboard
is
First Item
SCRIPTING
Exit shortcut with
Result
SCRIPTING
End If

If Result
COMMENT
The number below (default = 10) is a history limit number. You can change this how you wish. The history limit automatically clears your Clip History if it gets too large.
NUMBER
10

Number
VARIABLES
Set variable
Limit
to
Number
TEXT
Split
Clipboard
by
New Lines

Split Text
SCRIPTING
Count
Lines
in
Split Clipboard

Count
SCRIPTING
If
Lines
is greater than
10
SCRIPTING
Ask
Your clipping is larger than the history limit. Raise the limit?

Provided Input
SCRIPTING
If
Ask for Input
has any value
VARIABLES
Set variable
Limit
to
Ask for Input
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result
MATHS
Limit
-
1
Options Under Construction

Calculation Result
COMMENT
The repeat action below is the MVP of this shortcut. The repeat is necessary to filter out empty lines in the clipping.
SCRIPTING
If
Lines
is
1
MISSING
file Under Construction
SCRIPTING
Count
Lines
in
File

Count
SCRIPTING
If
Lines
is greater than or equal to
Limit
TEXT
Split
File
by
New Lines

Split Text
SCRIPTING
Get
Items in Range
1
to
Limit - 1
from
Loop Split

Item from List
TEXT
Combine
Range
with
New Lines

Combined Text
DOCUMENTS
Save
Combined Text
Destination Path
/Shortcuts/Clip History.txtOverwrite If File Exists

Saved File
SCRIPTING
End If

If Result
DOCUMENTS
Prepend
Clipboard
File Path
Clip History.txt

Appended File
DOCUMENTS
Save
Appended File
Destination Path
/Shortcuts/Clip History.txtOverwrite If File Exists

Saved File
SCRIPTING
Otherwise
COMMENT
The repeat action below is to reduce shortcut runtime for long clippings. And this keeps the order while filtering out empty lines.
SCRIPTING
Repeat with each item in
Split Clipboard

Repeat Results
SCRIPTING
If
Repeat Item
is not
<value>
DOCUMENTS
Append
Repeat Item

Appended File
DOCUMENTS
Save
Appended File
Destination Path
/Shortcuts/Temp File.txtOverwrite If File Exists

Saved File
SCRIPTING
End If

If Result
SCRIPTING
End Repeat

Repeat Results
MISSING
file Under Construction
SCRIPTING
Count
Lines
in
Temp File

Count
SCRIPTING
If
Temp Count
is less than
Limit
MATHS
Limit
-
Temp Count
Options Under Construction

Calculation Result
MISSING
file Under Construction
SCRIPTING
Count
Lines
in
File

Count
SCRIPTING
If
Count
is greater than or equal to
Calculation Result
TEXT
Split
File
by
New Lines

Split Text
SCRIPTING
Get
Items in Range
1
to
Calculation Result
from
Split Text

Item from List
TEXT
Combine
Item from List
with
New Lines

Combined Text
DOCUMENTS
Save
Combined Text
Destination Path
/Shortcuts/Clip History.txtOverwrite If File Exists

Saved File
SCRIPTING
End If

If Result
DOCUMENTS
Get text from
Temp File

Text
DOCUMENTS
Prepend
Text
File Path
Clip History.txt

Appended File
SCRIPTING
Otherwise
DOCUMENTS
Get text from
Temp File

Text
TEXT
Split
Text
by
New Lines

Split Text
SCRIPTING
Count
Items
in
Split Text

Count
SCRIPTING
If
Count
is less than
Limit
VARIABLES
Set variable
Limit
to
Count
SCRIPTING
End If

If Result
SCRIPTING
Get
Items in Range
1
to
Limit
from
Split Text

Item from List
TEXT
Combine
Item from List
with
New Lines

Combined Text
SCRIPTING
End If

If Result
DOCUMENTS
Save
If Result
Destination Path
/Shortcuts/Clip History.txtOverwrite If File Exists

Saved File
TEXT
Text

Text
DOCUMENTS
Save
Text
Destination Path
/Shortcuts/Temp File.txtOverwrite If File Exists

Saved File
SCRIPTING
End If

If Result