Absolute path of link, how ??
Absolute path of link, how ??
Hello,
I just installed FAR and I like it so far
I find it very useful to have a directory with links to my favourite places.
But when I click the link I only get the relative path starting from that directory.
How can I get the absolute path? I want to copy it in my clipboard.
I just installed FAR and I like it so far
I find it very useful to have a directory with links to my favourite places.
But when I click the link I only get the relative path starting from that directory.
How can I get the absolute path? I want to copy it in my clipboard.
Absolute path of link, how ??
well,
when I create a link in windows I can see the absolute path in explorer.
when I create a link in windows I can see the absolute path in explorer.
- John Doe
- Бюрократ
- Posts: 13851
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact:
Absolute path of link, how ??
Try execute this in cmdline:
lua:far.CopyToClipboard (far.GetReparsePointInfo (APanel.Current))
- John Doe
- Бюрократ
- Posts: 13851
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact:
Absolute path of link, how ??
%FARHOME%\Encyclopedia
Here is ready to use macro:
Here is ready to use macro:
Code: Select all
Macro { description="Copy link destination to clipboard";
area="Shell"; key="AltShiftIns";
id="43F9FF40-70B0-4308-B8C8-7262FB905757";
condition=function()
return not (APanel.Selected or APanel.Plugin and band(APanel.OPIFlags, far.Flags.OPIF_REALNAMES)==0)
end;
action=function()
local path = far.GetReparsePointInfo(APanel.Current)
if path and path~="\\" then
far.CopyToClipboard (path)
else
Keys"AKey"
end
end;
}
- John Doe
- Бюрократ
- Posts: 13851
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact:
Absolute path of link, how ??
Code: Select all
local ACTIVE,PASSIVE = 0,1;
Macro { description="Goto link destination";
area="Shell"; key="CtrlPgUp CtrlShiftPgUp";
id="256DFE10-768F-4DC6-9455-6FD5BD753D91";
condition=function()
return not APanel.Plugin or bit64.band(APanel.OPIFlags, far.Flags.OPIF_REALNAMES)~=0
end;
action=function()
local path = far.GetReparsePointInfo(APanel.Current)
if path then
local filename
if not APanel.Folder then
path,filename = path:match"^(.-)([^\\]+)$"
end
Panel.SetPath(mf.akey(1,1):find"Shift" and PASSIVE or ACTIVE, path, filename)
else
Keys"AKey"
end
end;
}
https://t.me/FarManager — Telegram чат
- John Doe
- Бюрократ
- Posts: 13851
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact:
Absolute path of link, how ??
Code: Select all
local HARDLINK = 4
local SYMLINK = 6
Macro { description="Goto link destination";
area="Dialog"; key="CtrlPgUp";
id="9EE3929C-09D8-4C81-8EA6-EDFDC0A25D91";
condition=function()
return Dlg.Id==far.Guids.FileAttrDlgId
end;
action=function()
local path
if Menu.Value~="" then
Keys"Enter"
path = Dlg.GetValue(HARDLINK)
elseif Dlg.GetValue(HARDLINK)~="" then
Dlg.SetFocus(HARDLINK)
Keys"CtrlDown"
return
else
path = Dlg.GetValue(SYMLINK)
end
if path~="" then
local filename
if not APanel.Folder then
path,filename = path:match"^(.-)([^\\]+)$"
end
Panel.SetPath(0, path, filename)
Keys"Esc"
end
end;
}
https://t.me/FarManager — Telegram чат
- HaRT
- Moderator
- Posts: 10858
- Joined: Tue 30 Aug, 2005 17:21
- Has thanked: 221 times
- Been thanked: 358 times
Absolute path of link, how ??
Is this check relevant in the File Attributes Dialog?
Фар есть инструмент, а не нянька. © 2009 DrKnS
- John Doe
- Бюрократ
- Posts: 13851
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact:
Absolute path of link, how ??
Absolutely relevant, just press CtrlA on any folder
https://t.me/FarManager — Telegram чат
- HaRT
- Moderator
- Posts: 10858
- Joined: Tue 30 Aug, 2005 17:21
- Has thanked: 221 times
- Been thanked: 358 times
Absolute path of link, how ??
Now I see how that can be useful for directory junctions and symlinks, but not for regular folders.
IMHO both scripts (for Shell and for Dialog) should include a in their
condition
.Ideally, the Dialog script has to be disabled for multiple selected panel items too.
Фар есть инструмент, а не нянька. © 2009 DrKnS
- John Doe
- Бюрократ
- Posts: 13851
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact:
Absolute path of link, how ??
Cases with regular folders / multiple objects are now covered by line
But your idea really makes sense if we want to have another macro on CtrlPgUp in this dialog, for plain files/folders.
if path~="" then
.But your idea really makes sense if we want to have another macro on CtrlPgUp in this dialog, for plain files/folders.
https://t.me/FarManager — Telegram чат
- HaRT
- Moderator
- Posts: 10858
- Joined: Tue 30 Aug, 2005 17:21
- Has thanked: 221 times
- Been thanked: 358 times
Absolute path of link, how ??
Indeed (though it's not immediately obvious at a glance).
It would be nice if this script also worked for the case of multiple hard links: the user opens the drop-down list of the links, chooses the link of interest, and invokes the script, and the script picks up the selected item and jumps to it.
Фар есть инструмент, а не нянька. © 2009 DrKnS
- John Doe
- Бюрократ
- Posts: 13851
- Joined: Wed 27 Apr, 2005 20:42
- Has thanked: 73 times
- Been thanked: 428 times
- Contact: