ShareShortcuts
Создать форк «Copy Between What»

Создали что-то новое на основе этой команды? Поделитесь ей как форком: она станет вашей собственной командой, которой вы управляете, а обе страницы будут ссылаться друг на друга, чтобы hunter9888x получил(а) признание.

  1. 1Получите команду и измените её в приложении «Быстрые команды». Дайте ей собственное название.
  2. 2Поделись ею из приложения «Быстрые команды» и скопируй ссылку iCloud.
  3. 3Вернись сюда, вставь ссылку и опиши, что изменилось, например: «Добавлен шаг, который использует Apple Intelligence для персонализации текста».
Загрузки
63K
Сохранено
1
Действия
66
Категория
Utilities
Версия
2.1
Язык
EN

Copy between a specific text or symbol

Then deletes the text or symbol between what was copied

Option to create a folder & option to save too

Adds one empty line between matches

& option to have no empty lines

However, when you specifically search for metacharacters such as .[{()\^$|?*+, you need to escape them with backslash \, so they can be recognized.

For example, if you need to find ., type \. in the search field.

Example: I specify

( on left side & ) on right side

(some text) than it would delete ( )

& save some text To a file

Created by me

Что нового

Версия 2.1

Better version

История версий
2.1 20 янв 2020 г.

Better version

2.0 6 янв 2020 г.

Adds empty line

1.0 6 янв 2020 г.

First release

Что делает

Действий: 66
  1. Choose from Menu
    copy between what
  2. Choose from Menu
    both sides of text
  3. Ask for Input
    Look For what on left & right side of text
  4. Set Variable
    Both sides of text
  5. Get File
  6. Repeat with Each
  7. Get Name
  8. Set Variable
    Name
  9. Get Text from Input
  10. Set Variable
    Get text
  11. Match Text
  12. Text
  13. Set Name
  14. Choose from Menu
    both sides of text (save)
  15. Ask for Input
    Look For what on left & right side of text
  16. Set Variable
    Both sides of text
  17. Get File
  18. Repeat with Each
  19. Get Name
  20. Set Variable
    Name
  21. Get Text from Input
  22. Set Variable
    Get text
  23. Match Text
  24. Text
  25. Set Name
  26. Save File
  27. Stop This Shortcut
  28. Choose from Menu
    two different sides of text
  29. Ask for Input
    Look for what on left side of text
  30. Set Variable
    Left side of text
  31. Ask for Input
    Look for what on right side of text
  32. Set Variable
    Right side of text
  33. Get File
  34. Repeat with Each
  35. Get Name
  36. Set Variable
    Name
  37. Get Text from Input
  38. Set Variable
    Get text
  39. Match Text
  40. Text
  41. Set Name
  42. Choose from Menu
    two different sides of text (save)
  43. Ask for Input
    Look for what on left side of text
  44. Set Variable
    Left side of text
  45. Ask for Input
    Look for what on right side of text
  46. Set Variable
    Right side of text
  47. Get File
  48. Repeat with Each
  49. Get Name
  50. Set Variable
    Name
  51. Get Text from Input
  52. Set Variable
    Get text
  53. Match Text
  54. Text
  55. Set Name
  56. Save File
  57. Stop This Shortcut
  58. Choose from Menu
    create folder
  59. Ask for Input
    Set folder name to use
  60. Set Variable
    New folder
  61. Create Folder
  62. Show Result
  63. Stop This Shortcut
  64. Create Folder
  65. Save File
  66. Show Result

Посмотреть как код
Бета

Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.

#include 'actions/text'
#define color purple
#define glyph magicWandAlt


menu "copy between what " {
item "both sides of text":
	prompt("Look For what on left & right side of text")
	@BothSidesOfText
	const File = getFileFromFolder(, "")
	for _ in File {
		getName(@RepeatItem)
		@Name
		getText(@RepeatItem)
		@GetText
		containsText(@GetText, "\{@BothSidesOfText}.*\{@BothSidesOfText}")
		const Text = "{}"
		setName(Text, @Name)
	}
item "both sides of text (save)":
	prompt("Look For what on left & right side of text")
	@BothSidesOfText
	const File = getFile("")
	for _ in File {
		getName(@RepeatItem)
		@Name
		getText(@RepeatItem)
		@GetText
		containsText(@GetText, "\{@BothSidesOfText}.*\{@BothSidesOfText}")
		const Text = "{}"
		setName(Text, @Name)
	}
	const SavedFile = saveFilePrompt(RepeatResults)
	stop()
item "two different sides of text":
	prompt("Look for what on left side of text")
	@LeftSideOfText
	prompt("Look for what on right side of text")
	@RightSideOfText
	const File1 = getFile("")
	for _ in File1 {
		getName(@RepeatItem)
		@Name
		getText(@RepeatItem)
		@GetText
		containsText(@GetText, "\{@LeftSideOfText}.*\{@RightSideOfText}")
		const Text1 = "{}"
		setName(Text1, @Name)
	}
item "two different sides of text (save)":
	prompt("Look for what on left side of text")
	@LeftSideOfText
	prompt("Look for what on right side of text")
	@RightSideOfText
	const File1 = getFile("")
	for _ in File1 {
		getName(@RepeatItem)
		@Name
		getText(@RepeatItem)
		@GetText
		containsText(@GetText, "\{@LeftSideOfText}.*\{@RightSideOfText}")
		const Text1 = "{}"
		setName(Text1, @Name)
	}
	const SavedFile1 = saveFilePrompt(RepeatResults1)
	stop()
item "create folder":
	prompt("Set folder name to use")
	@NewFolder
	createFolder(@NewFolder)
	show("New folder is /Shortcuts/{@NewFolder}")
	stop()
}
createFolder("copy between what")
saveFile("copy between what", MenuResult, true)
show("In folder /Shortcuts/copy between what")
Открыть в Cherri Playground Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.

Оценки и отзывы

Написать отзыв
–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Пока нет отзывов. Поделись мнением первым!

Реклама

Ещё от hunter9888x

См. все

Вам также может понравиться

См. все
Реклама