Skip to content

Commit

Permalink
#20: use input as argv, quote arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
artemy committed Dec 4, 2024
1 parent 1e3f00b commit 7035193
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions alfred/template.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<key>escaping</key>
<integer>102</integer>
<key>script</key>
<string>open -nb $bundle_id --args $@</string>
<string>open -nb "${bundle_id}" --args "${1}"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand Down Expand Up @@ -59,4 +59,4 @@
<key>webaddress</key>
<string>https://github.com/artemy/alfred-jetbrains-projects</string>
</dict>
</plist>
</plist>
8 changes: 4 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def create_script_filter(product: Product) -> dict:
'queuedelaymode': 0,
'queuemode': 1,
'runningsubtext': '',
'script': f'/usr/bin/python3 recent_projects.py {product.keyword} "{{query}}"',
'scriptargtype': 0,
'script': f'/usr/bin/python3 recent_projects.py "{product.keyword}" "${{1}}"',
'scriptargtype': 1,
'scriptfile': '',
'subtext': '',
'skipuniversalaction': True,
Expand Down Expand Up @@ -71,10 +71,10 @@ def create_coordinates(xpos: int, ypos: int) -> dict[str, int]:

def get_run_script_uid(plist) -> str:
for obj in plist["objects"]:
if obj["config"]["script"] == 'open -nb $bundle_id --args $@' and obj["uid"] is not None:
if obj["config"]["script"] == 'open -nb "${bundle_id}" --args "${1}"' and obj["uid"] is not None:
return obj["uid"]
raise ValueError(
f"Could not find the script object with 'open -nb $bundle_id --args $@' as the script in the template")
f'Could not find the script object with \'open -nb "${{bundle_id}}" --args "${{1}}"\' as the script in the template')


def create_coordinate_ruler(size: int) -> list[int]:
Expand Down

0 comments on commit 7035193

Please sign in to comment.