Name

Resolve

Synopsis

$link->Resolve([flag])

Attempts to automatically resolve a shortcut and returns the resolved path, or undef on error; if there is no resolution, the path is returned unchanged. Note that the path is automatically updated in the Path property of the shortcut.

By default, this method acts quietly, but if you pass a value of 0 in the flagparameter, it will eventually post a dialog box prompting the user for more information. For example:

# If the target doesn't exist...
if(! -f $link->Path) {

    # Save the actual target for comparison
    $oldpath = $link->Path;

    # Try to resolve it (with dialog box)
    $newpath = $link->Resolve(0); 

    die "Not resolved..." if $newpath == $oldpath;
}

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.