DOpus.aliases.add... whats wrong?

image

It needed to be "C:\\Portable\\"

Annoying details.

Also that screenshot did not have ; after the aliases line.

Javascript, as with most programming and scripting languages, needs backslashes to be escaped.

(You can usually use forward slashes instead to avoid it, if it bothers you.)

How do I use the alias here? \Port is fail.

@script jscript
function OnClick(clickData)
{	
DOpus.Aliases.Add( "Port"	, "C:\\Portable\\");
DOpus.Aliases.Add( "Links", \Port "Links\\");
DOpus.Aliases.Update();
}
DOpus.Aliases.Add("Links", \Port "Links\\");

That's not valid JScript. If you want one alias to point to a folder below the other, just use the alias in the path/string:

DOpus.Aliases.Add("Links", "/Port\\Links\\");

Thanks.

I also got it this way.

@script jscript
function OnClick(clickData)
{
DOpus.Aliases.Add( "Port"	, "C:\\Portable\\");
DOpus.Aliases.Add( "Links", DOpus.aliases("Port").path + "\\Links\\" );

// DOpus.Output(DOpus.aliases("Port").path)
}

Note that the slashes added in Port were ignored, and had to be added again is "\\Links\\"

If you do it that way you may as well just assign Links to C:\Portable\Links directly, since the 2nd alias will be pointing to the full path, not relative to the first alias.

Making the 2nd relative to the 1st may be better as it means you only have to edit the first one if it moves to another folder.

This results the Alias path displaying "/Port\Links" which works. This way, Alias would not require updating if /Port changes. Nice.