Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ def fake_run(args, **kwargs):

assert result["action"] == "reveal_in_finder"
assert seen["args"][0] == "osascript"
# Finder's `reveal` needs an alias/file reference; a bare `POSIX file`
# specifier raises -1728 ("Can't get POSIX file ..."). Ensure we coerce.
script = " ".join(seen["args"])
assert "as alias" in script
assert "reveal POSIX file (item 1 of argv)" not in script


def test_get_finder_selection_parses_alias_output(monkeypatch):
Expand Down
2 changes: 1 addition & 1 deletion tools/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def reveal_in_finder(path: str) -> str:
script = (
'on run argv\n'
' tell application "Finder"\n'
' reveal POSIX file (item 1 of argv)\n'
' reveal (POSIX file (item 1 of argv) as alias)\n'
" activate\n"
" end tell\n"
"end run\n"
Expand Down