news |
info |
people |
software |
stuff |
Alias XFCN. Version 1.1d2, by Sam Deane. Copyright ©1994 ULTRALAB. Compiled 16:54:45, 28/04/94. Debugging code included.
The Alias XFCN gives you access to most of the features of the Alias Manager.
If you have a file that your stack needs to refer to, you can use the make command to create an alias to it. The alias is stored in your stack in an alis resource. You can use the list command to get a list of all the alis resources stored in a stack.
Later when you want the file again, you can use the resolve command on one of the resources, which will attempt to find the file for you. If the file has been renamed or moved, the resolve command should still be able to find it. If the file was on a volume that is not mounted, the command will ask you to mount that volume, or even do it for you if it can.
If the resolve command fails to find the file, you can also use the find command to perform a more extensive (but time consuming) search.
Commands
makeThe syntax is:
get Alias("make",<path> {,<name>})
The <path> parameter should be the path of the file to alias.
The optional <name> parameter can be used to tell the XCMD what name to give the alis resource.
The command returns the id of the new alis resource.
Example script for make
on mouseUp
-- get new one
answer file "File to make alias for?"
if it is not empty then
get alias("make",it,filename(it))
end if
end mouseUp
function filename path
set the itemDelimiter to ":"
get last item of path
set the itemDelimiter to comma
return it
end filename
resolveThe syntax is:
get alias("resolve",<name>)
The <name> parameter should contain the name or id of the alis resource to use.
Example script for resolve
on mouseUp
get Alias("list")
if it is not empty then
get alias("resolve",line 1 of it)
put it
end if
end mouseUp
findThe syntax is:
get alias("find",<name>)
The <name> parameter should contain the name or id of the alis resource to use.
Example script for find
on mouseUp
get Alias("list")
if it is not empty then
get alias("find",line 1 of it)
put it
end if
end mouseUp
alternativesThe syntax is:
get alias("alternatives",<name>)
The <name> parameter should contain the name or id of the alis resource to use.
If one or more likely files are found, the result of this search will be returned as a comma delimited list of paths to them.
Example script for alternatives
on mouseUp
get Alias("list")
if it is not empty then
answer alias("alternatives",line 1 of it)
end if
end mouseUp
listThe syntax is:
get Alias("list")
Example script for list
on mouseUp
answer alias("list")
end mouseUp
removeThe syntax is:
get Alias("remove",<name>)
The <name> parameter should contain the name or id of the alis resource to remove.
Example script for remove
on mouseUp
get alias("list")
if it is not empty then
get alias("remove",line 1 of it)
end if
end mouseUp
updateThe syntax is:
get Alias("update",<name>,<path>)
The <name> parameter should contain the name or id of the alis resource to update.
The <path> parameter should contain the new path for to alias to point at.
Example script for update
on mouseUp
get Alias("list")
if it is not empty then
put it into oldAlias
answer file "Which file?"
if it is not empty then
put alias("update",oldAlias,it)
end if
end if
end mouseUp
finderThe syntax is:
get Alias("finder",<path>)
The <path> command should be a path to a finder alias file. The result of this will be the true path name of the file that the alias represents.
Example script for finder
on mouseUp
answer "Path to resolve"
if it is not empty then
put alias("finder",it)
end if
end mouseUp