Recreate an alias with the same name and timestamp programmatically
Create a Service with Automator — Tested on macOS Sierra


Open /Applications/Automator.app
File > New (cmd-N)


Choose a type of document: "Service".

Service receives selected: "files or folders" in "Finder".
In the left pane navigate to: Actions > Library > Utilities > Run AppleScript.


Drag the "Run AppleScript" item from the library pane on the left to the source code pane on the right.

Clear the prefilled content entirely. Paste in the following source code:


AppleScript Source Code

use framework "Foundation" -- Cocoa-AppleScript

on run {input, parameters}
    repeat with thisItem in input
        tell application "Finder"
            if kind of thisItem is "Alias" then -- alias file only
                set parentPath to container of thisItem -- get the folder of this alias
                set {label index:l, comment:c, modification date:m, creation date:cr, original item:origPath, name:n} to properties of (item thisItem)
                if origPath is not missing value then -- not a breaking alias
                    set tagsList to (my tagsFor:(POSIX path of thisItem)) -- get the tags of the alias file (call an AppleScriptObjC handler)
                    delete thisItem -- move this alias to the trash

                    -- ** create an alias file **
                    set newAliasFile to make new alias at parentPath to origPath with properties {comment:c, creation date:cr, original item:origPath, name:n}
                    -- ** set the label ** (0 = no label)
                    if l is not 0 then set label index of newAliasFile to l
                    -- ** set  the tags ** ({} = no tag) 
                    if tagsList is not {} then (my setTags:tagsList forPath:(POSIX path of (newAliasFile as string))) -- call an AppleScriptObjC handler
                    -- ** change the modification date **
                    set modification date of newAliasFile to m
                end if
            end if
        end tell
    end repeat
end run

on tagsFor:posixPath -- Cocoa-AppleScript handler 
    set fileURL to current application's |NSURL|'s fileURLWithPath:posixPath
    set {theResult, theTags} to fileURL's getResourceValue:(reference) forKey:(current application's NSURLTagNamesKey) |error|:(missing value)
    if theTags = missing value then return {} -- no tags
    return theTags as list
end tagsFor:

on setTags:tagList forPath:posixPath -- Cocoa-AppleScript handler
    set fileURL to current application's |NSURL|'s fileURLWithPath:posixPath
    fileURL's setResourceValue:tagList forKey:(current application's NSURLTagNamesKey) |error|:(missing value)
end setTags:forPath:



File > Save (cmd-S): Give it a name like "Alias recreation".
Open System Preferences > Keyboard > Shortcuts > Services > Files and folders > Alias recreation, or however else you named it.


Assign it a shortcut. As cmd-L is used to create an alias (L as in "link"), I assigned it cmd-alt-ctrl-L.

Select one or multiple legacy alias files, and process them.


With your shortcut cmd-alt-ctrl-L.
or through the main menu: Finder > Services > Files and folders > Alias recreation.



Note: The batch process is very transparent and mistakes can be corrected. The deleted aliases are moved to your Trash bin. Should you have made a mistake choose the trashed alias file in question and run Finder > Put back (cmd-backspace). This will put the file back in its previous parent folder and open the parent folder in a new window. Then you have the recreated alias and the original alias with the suffix " copy" side by side and can make corrections if necessary.