Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dffae321
Commit
dffae321
authored
Aug 03, 2001
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Obsolete: uses old applescript support.
parent
b4c975a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
33 deletions
+0
-33
Mac/Lib/test/testfinderopen.py
Mac/Lib/test/testfinderopen.py
+0
-33
No files found.
Mac/Lib/test/testfinderopen.py
deleted
100644 → 0
View file @
b4c975a3
"""Make the finder open an application, file or folder"""
import
Finder_7_0_Suite
import
aetools
import
MacOS
import
sys
import
macfs
SIGNATURE
=
'MACS'
class
Finder
(
aetools
.
TalkTo
,
Finder_7_0_Suite
.
Finder_7_0_Suite
):
pass
def
open_in_finder
(
file
):
"""Open a file thru the finder. Specify file by name or fsspec"""
finder
=
Finder
(
SIGNATURE
)
fss
=
macfs
.
FSSpec
(
file
)
vRefNum
,
parID
,
name
=
fss
.
as_tuple
()
dir_fss
=
macfs
.
FSSpec
((
vRefNum
,
parID
,
''
))
file_alias
=
fss
.
NewAlias
()
dir_alias
=
dir_fss
.
NewAlias
()
return
finder
.
open
(
file_alias
,
items
=
[
file_alias
])
def
main
():
fss
,
ok
=
macfs
.
PromptGetFile
(
'File to launch:'
)
if
not
ok
:
sys
.
exit
(
0
)
result
=
open_in_finder
(
fss
)
if
result
:
print
'Result: '
,
result
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment