topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 11:05 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Get Filepath  (Read 14337 times)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Get Filepath
« on: April 07, 2008, 10:15 PM »
this is a small program written in AHK to get the file-path of the file parsed at command-line. the story behind this: whenever i'm viewing a document/image, sometimes i'd need the file-name or path. and for that purpose, this can be used where you can assign this program as an "external tool" and use the hot-key/menu to access this item. if it was a legitimate file then a tooltip will appear saying file-path is copied. if there is any improvements that can be made, feel free to download the source and modify.

IrfanView as an example
ws-sshot-1.png

Edit1: added a small usage demo. btw, the tray-tip couldn't be captured, so i'm pointing at nothing in the tray area (where the icon briefly appears). ;)

http://lanux128.dcmembers.com/misc/Using_Get_Filepath_with_IrfanView.swf

Edit2: fixed the demo link.
« Last Edit: May 26, 2010, 02:17 AM by lanux128 »

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • View Profile
    • Donate to Member
Re: Get Filepath
« Reply #1 on: April 08, 2008, 05:58 AM »
Another way to get the filepath:

http://home.worldonl...reeutil.htm#pathcopy
« Last Edit: April 08, 2008, 06:02 AM by wr975 »

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Get Filepath
« Reply #2 on: April 08, 2008, 06:51 AM »
Nice work Lanux be sure to add a shorcut to GetFilePath.exe to your SendTo folder (start -> run -> sendto OR start -> shell:sendto) for it to be availalble in nearly any application. For some reason the traytip is not showing for me on vista (but there's no fault in your code so I assume a restart will fix that for me)

I was adding in automatic drive mapping for UNC but got stuck and had to give up. It's easy to detect if the first two characters are \\ and you can run the command "net use * %filepath%" to map to a available drive. However I'm not sure how to retrieve the output of net use, take the 2nd word from the 1st line (which is the drive letter) to form the new filepath string.


Edit: Success! added UNC mapping., the folder in which the file resides is automatically mapped to a driveletter.


« Last Edit: April 08, 2008, 07:36 AM by justice »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Get Filepath
« Reply #3 on: April 08, 2008, 09:29 PM »
justice: thanks for adding the UNC path and for traytip, i'm not sure why it doesn't show-up (no Vista here) but try changing the 'sleep' time. :)

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: Get Filepath
« Reply #4 on: April 08, 2008, 11:14 PM »
Thanks lanux.

(I use farr a lot to quickly get full path to files, links, etc. (ctrl+c on the selected item) )

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Get Filepath
« Reply #5 on: April 09, 2008, 12:32 AM »
you're welcome, Armando. :) i too sometimes use Farr get file-paths but this tool is useful when the image/document is already open and the Windows context-menu is not available. btw, i've added a small demo on the usage since i sure it will be more clearer that way.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Get Filepath
« Reply #6 on: April 09, 2008, 05:53 AM »
No problems now with the tray tip by the way, I had more problems that session but a restart fixed it. Also this would be a good progrma to add to a barnacle toolbar if you're using that.
« Last Edit: April 09, 2008, 05:55 AM by justice »

delwoode

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 146
    • View Profile
    • Donate to Member
Re: Get Filepath
« Reply #7 on: April 06, 2011, 08:53 AM »
I must be really dumb as I couldnt understand what the video was trying to show me