-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_import_tool_alias.scpt
More file actions
37 lines (31 loc) · 1.29 KB
/
Copy pathcreate_import_tool_alias.scpt
File metadata and controls
37 lines (31 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
tell application "Finder"
-- Get the current directory path
set currentPath to POSIX path of (container of (path to me) as alias)
-- Check if we're already in the MushLog-v1.3 directory or need to navigate to it
set launchScriptPath to ""
-- Try to find the launch_import_tool.sh file
try
-- First try: current directory
set launchScriptPath to currentPath & "launch_import_tool.sh"
set originalItem to POSIX file launchScriptPath as alias
on error
try
-- Second try: MushLog-v1.3 subdirectory
set launchScriptPath to currentPath & "MushLog-v1.3/launch_import_tool.sh"
set originalItem to POSIX file launchScriptPath as alias
on error
-- Third try: parent directory/MushLog-v1.3
set parentPath to POSIX path of (container of (container of (path to me) as alias) as alias)
set launchScriptPath to parentPath & "MushLog-v1.3/launch_import_tool.sh"
set originalItem to POSIX file launchScriptPath as alias
end try
end try
-- Set the path to the desktop where you want to create the alias
set aliasLocation to path to desktop folder
-- Create the alias
make new alias file at aliasLocation to originalItem
-- Set a custom name for the alias
set name of result to "MushLog"
-- Display confirmation message
log "MushLog alias created successfully on Desktop!"
end tell