Skip to content

Commit

Permalink
fix: presets alternative text
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminOddou committed Apr 22, 2023
1 parent c854fe7 commit 0c2c10e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ Go to the dedicated [GitHub repository](https://github.com/BenjaminOddou/alfred-
<true/>
</dict>
<key>description</key>
<string>This folder contains presets and logs outputs</string>
<string>this folder contains presets and logs outputs.</string>
<key>label</key>
<string>📂 Data folder</string>
<key>type</key>
Expand All @@ -1675,7 +1675,7 @@ Go to the dedicated [GitHub repository](https://github.com/BenjaminOddou/alfred-
<true/>
</dict>
<key>description</key>
<string>Keyword that launches the workflow</string>
<string>keyword that launches the workflow.</string>
<key>label</key>
<string>🕹️ Trigger</string>
<key>type</key>
Expand All @@ -1696,7 +1696,7 @@ Go to the dedicated [GitHub repository](https://github.com/BenjaminOddou/alfred-
<true/>
</dict>
<key>description</key>
<string>Input a value between 1 and ∞.</string>
<string>input a value between 1 and ∞. allows to compress images in nested folders.</string>
<key>label</key>
<string>🔍 Depth of the search</string>
<key>type</key>
Expand Down Expand Up @@ -1730,7 +1730,7 @@ Go to the dedicated [GitHub repository](https://github.com/BenjaminOddou/alfred-
</array>
</dict>
<key>description</key>
<string>Choose output action.</string>
<string>choose output action.</string>
<key>label</key>
<string>🔫 Workflow action</string>
<key>type</key>
Expand Down Expand Up @@ -1824,7 +1824,7 @@ Go to the dedicated [GitHub repository](https://github.com/BenjaminOddou/alfred-
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>3.0.1</string>
<string>3.0.2</string>
<key>webaddress</key>
<string>https://github.com/BenjaminOddou/alfred-smart-webp-compression</string>
</dict>
Expand Down
11 changes: 6 additions & 5 deletions src/presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ try {
if (action == 'new') {
const uuid = $.NSUUID.UUID.UUIDString.js
const _new_preset = $.NSProcessInfo.processInfo.environment.objectForKey('_new_preset')?.js || ''
const args = $.NSProcessInfo.processInfo.arguments.objectAtIndex(4).js
const title = args.split('/')[0]
const subtitle = args.split('/')[1]
const args = $.NSProcessInfo.processInfo.arguments.objectAtIndex(4).js.split('/')
const title = args[0]?.trim() !== '' ? args[0]?.trim() : 'No title';
const subtitle = args[1]?.trim() !== '' ? args[1]?.trim() : 'No description';
items.push(
{
title: `${title}`,
Expand All @@ -54,8 +54,9 @@ try {
const new_value = $.NSProcessInfo.processInfo.arguments.objectAtIndex(4).js
const key = $.NSProcessInfo.processInfo.environment.objectForKey('modif6')?.js || ''
if (type == 'tl&sb') {
const title = new_value.split('/')[0]
const subtitle = new_value.split('/')[1]
const args = new_value.split('/')
const title = args[0]?.trim() !== '' ? args[0]?.trim() : 'No title';
const subtitle = args[1]?.trim() !== '' ? args[1]?.trim() : 'No description';
content.items.forEach(item => {
if (item.id == key) {
item.title = title
Expand Down

0 comments on commit 0c2c10e

Please sign in to comment.