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, 1:17 pm
  • 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

Last post Author Topic: IDEA: Create a containing folder by right clicking on a file  (Read 105989 times)

BigJim

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 178
  • I have seen the light!
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #50 on: October 26, 2007, 07:47 AM »
The shift key to edit name doesn't work for me. :(
It did for me the first time then seems to have stopped. Strange.   :tellme:
TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #51 on: October 26, 2007, 08:13 AM »
Not once for me.... :(

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #52 on: October 26, 2007, 10:17 AM »
That's really weird... I don't know where to look for. We'll see.

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #53 on: October 27, 2007, 12:54 AM »
ahhaahahahahaha that drawing is priceless



Yes. AK_ should try doing one for farr too. Or maybe we could do another contest?

Armando

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,727
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #54 on: October 27, 2007, 01:00 AM »
The shift key to edit name doesn't work for me. :(
It did for me the first time then seems to have stopped. Strange.   :tellme:

It works perfectly well for me. I 1- right click on a file, 2- go to the "send to" sub-menu, 3- press shift and left click (while pressing shift) on Filenany OR , 1- right click on a file name to trigger the context menu, 2- press shift and left click (while pressing shift) on the “FileNanny this” option. A window then pops up allowing me to edit the name. Works all the time.
« Last Edit: October 27, 2007, 01:02 AM by Armando »

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #55 on: October 27, 2007, 09:11 AM »
I got it to work - seems it's a matter of timing... ;D

BigJim

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 178
  • I have seen the light!
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #56 on: October 27, 2007, 12:52 PM »
Could you elaborate on that, CleverCat?
TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #57 on: October 27, 2007, 02:26 PM »
Actually, the program checks if the Shift key is down when it starts. So you can press the shift key before launching Filenanny (and keep it down when you launch it, of course). That's why Armando's method should work, that's what i do.

BigJim

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 178
  • I have seen the light!
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #58 on: October 27, 2007, 05:33 PM »
OK, I think I've got it now. Thanks.  :Thmbsup:

It seems to me, though, that the times that you would NOT want to do some small edit of the folder name are very few. I would favor having it go directly to the rename box by default and do away with the shift key altogether. If you didn't want to make a change you're already a lot of clicks and keystrokes ahead of the game and could simply hit the OK button.

Having said that, since the whole point and value of your app is streamlining the process, how about having it deliver you right to the new folder after hitting OK? Almost always, after downloading and saving a file, you'll want to open it, unzip it or whatever and this would be a further advantage.   8)
TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #59 on: October 27, 2007, 06:16 PM »
Really nice work, ak_!!  :)


If one day you are going to work on this program again, then maybe you would consider to change two letters, the "f" and the first "n", to capital "F" and "N", please? The name of the program clearly is FileNanny (capital F and N), but the exe file is named filenanny.exe (f and n). So when I used FileNanny to tell filenanny to go to her room, she didn't went to FileNanny, but to filenanny.

- Sorry for making a short story long...

Fine program!  :up:

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #60 on: October 28, 2007, 09:01 AM »
Could you elaborate on that, CleverCat?

The timing of holding shift key and when to let go - I use Sticky Keys...

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #61 on: October 28, 2007, 09:44 AM »
BigJim> if a majority of people agrees with you, i'll change it. Thanks.

Curt> ok i'll rename the exe (that shouldn't be too much work :))

CleverCart> You don't have to let it go at a precise time. Just press it before launching FileNanny (via context menu or 'Send to' menu) and release it when the box appears.

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #62 on: November 04, 2007, 11:27 PM »
I was letting go before box appeared  ;D

Works fine now! :Thmbsup:

nosh

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,441
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #63 on: November 05, 2007, 12:39 AM »
ak_ I really think the program needs to start looking for the (.) starting from the right and not the left, lots of files one downloads have names like Program_x.x.x.exe - the current logic just slashes off everything since it seems to look for the period from L-R.

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #64 on: November 05, 2007, 04:54 AM »
Ok i think i'll do that nosh. Thanks.

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #65 on: November 05, 2007, 08:57 AM »
Edited for courtesy...

I don't want a folder to be named "x.12.2.5.23.5"

But maybe the choice can be added as an option?
« Last Edit: November 05, 2007, 09:26 AM by Curt »

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #66 on: November 05, 2007, 11:20 AM »
I think i'll add a config window with a few options, like :
- custom context-menu text
- convert . - _ %20 to spaces in folder name
- "Custom folder mode" as described there :
It seems to me, though, that the times that you would NOT want to do some small edit of the folder name are very few. I would favor having it go directly to the rename box by default and do away with the shift key altogether. If you didn't want to make a change you're already a lot of clicks and keystrokes ahead of the game and could simply hit the OK button.
-BigJim

Any ideas are welcome :)

nosh

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,441
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #67 on: November 05, 2007, 11:44 AM »
Merci
:)

BigJim

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 178
  • I have seen the light!
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #68 on: November 05, 2007, 12:21 PM »
Go for it!!   :Thmbsup:   :greenclp:
TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."

shinigamijusan

  • Participant
  • Joined in 2008
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #69 on: January 30, 2008, 04:21 PM »
Doh!

BigJim

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 178
  • I have seen the light!
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #70 on: January 30, 2008, 06:06 PM »
to DonationCoder!

Doh!
-shinigamijusan (January 30, 2008, 04:21 PM)

Think you could elaborate on that comment??
TruckerJim says "You can go down a hill too slow a thousand times. But too fast only once."

nogojoe

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 169
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #71 on: February 03, 2008, 03:05 AM »
I think i'll add a config window with a few options, like :
- custom context-menu text
- convert . - _ %20 to spaces in folder name
- "Custom folder mode" as described there :
It seems to me, though, that the times that you would NOT want to do some small edit of the folder name are very few. I would favor having it go directly to the rename box by default and do away with the shift key altogether. If you didn't want to make a change you're already a lot of clicks and keystrokes ahead of the game and could simply hit the OK button.
-BigJim

Any ideas are welcome :)

Thanks AK for filenanny.  :Thmbsup:

Have just picked up a bug. :down:

Tried to convert a file named PremiumBooster.zip and it wouldn’t do the business after successfully converting several hundred files without any problem.

Took a hunch and put a space between Premium and Booster and it worked OK  :up:

nogojoe
Often the most convincing people are those who have lost the plot so much they don't recognize the difference between fact and fantasy

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #72 on: April 09, 2008, 06:52 PM »
Ok, it's been quite a long time :)

Here's the latest version of FileNanny.
[attachmini=#1][/attachmini]

What's new ?
  • File name is now FileNanny with two capital letters (that's for Curt)
  • You can choose your own context menu text from the GUI
  • You can choose wether you want . - _ and %20 converted to spaces or not
  • Two modes : you can modify folder name only if you press Shift while launching FileNanny OR you can always modify folder name unless you press Shift while launching FileNanny (you choose that in the GUI)
  • FileNanny doesn't mess up with files containing multiple dots anymore (only the extension is removed)
  • Files without extension are handled

I think that's it :) Any proposition or bug report is welcome. By the way, nogojoe, i have no idea where the bug you talk about comes from. It's really weird.

Here's the code, i think it's quite messy but i don't really feel like cleaning it up right now :)
Spoiler
;; FileNanny
;; "Go to your room !"
;; by ak

#SingleInstance ignore
iniFile = %A_ScriptDir%\FileNanny.ini
if 0 = 0
{
gosub CreateGUI
gosub checkboxes
}

else
{
Iniread shiftKey, %iniFile%, options, shiftKey
GetKeyState kstate, Shift
if (shiftKey = 1 and kstate = "D")
  editFolder = 1
if (shiftKey = 0 and kstate = "U")
  editfolder = 1
Loop, %0%
{
param := %A_Index%
SplitPath param, fileName, dirName, extension, fileNameNoExt
rawName = %fileNameNoExt%
gosub convert
if editFolder = 1
{
  InputBox InputRawName, FileNanny, Name of the folder to create, , 320, 120, , , , , %rawName%
  rawName = %InputRawName%
  if ErrorLevel
    ExitApp
}
FileMove %param%, %param%.FileNanny
dirToCreate = %dirName%\%rawName%
FileCreateDir %dirToCreate%
FileMove %param%.FileNanny, %param%
fileNewName = %rawName%.%extension%
FileMove %param%, %dirToCreate%\%fileNewName%
}
ExitApp
}
return

CreateGUI:
  gui destroy
  RegRead, regTest, HKEY_CLASSES_ROOT, *\shell\FileNanny
  if strlen(regTest) = 0
  {
    button1Text = Add context menu item
    button1Action = addCMI
  }
  else
  {
    button1Text = Remove context menu item
    button1Action = remCMI
  }
 
  sendToFolder = %UserProfile%\SendTo
  ifnotExist %sendToFolder%\filenanny.lnk
  {
    button2text = Add 'Send to' shortcut
    button2action = addST
  }
  else
  {
    button2text = Remove 'Send to' shortcut
    button2action = remST
  }
 
  Gui, Add, Button, x126 y195 w70 h30 gQuit, Quit
  Gui, Add, Tab, x3 y5 w315 h230 vSelectedTab, Configuration|Options
  Gui, Font, s9 w600
  Gui tab, Configuration
  Gui font, norm
  Gui, Add, Button, x90 y65 w140 h30 g%button1Action% vCMIb, %button1Text%
  Gui, Add, Button, x90 y125 w140 h30 g%button2Action% vSTb, %button2Text%
  Gui tab, Options
  if strlen(regTest) = 0
  {
    regTest = n/a
    disabledOrNot = disabled
  }
  Gui, Add, text, x26 y59 w190 h20 vCurrentCMI, Current : %regTest%
  Gui, Add, Button, x226 y55 w70 h20 %disabledOrNot% gchangeCMI vCMIc, Change
  Gui, Add, GroupBox, x16 y35 w290 h50 , Context menu text
  Gui, Add, CheckBox, x16 y95 w300 h30 vshiftKey gini, Holding the Shift key is required to modify `nfolder name before its creation
  Gui, Add, GroupBox, x16 y135 w290 h50 , Convert these to spaces
  Gui, Add, CheckBox, x30 y150 w50 h30 vconvDot gini, .
  Gui, Add, CheckBox, x80 y150 w50 h30 vconvMinus gini, -
  Gui, Add, CheckBox, x130 y150 w50 h30 vconvUnderscore gini, _
  Gui, Add, CheckBox, x180 y150 w50 h30 vconvPercent gini, `%20
  Gui, Show, h240 w320, FileNanny
return

ini:
Gui submit, NoHide
Iniwrite %shiftKey%, %iniFile%, options, shiftkey
Iniwrite %convDot%, %iniFile%, convert, dots
Iniwrite %convMinus%, %iniFile%, convert, minus
Iniwrite %convUnderscore%, %iniFile%, convert, underscore
Iniwrite %convPercent%, %iniFile%, convert, percent
return

checkBoxes:
Iniread shiftKey, %iniFile%, options, shiftKey
Iniread convDot, %iniFile%, convert, dots
Iniread convMinus, %iniFile%, convert, minus
Iniread convUnderscore, %iniFile%, convert, underscore
Iniread convPercent, %iniFile%, convert, percent
Guicontrol ,,shiftKey, %shiftKey%
Guicontrol ,,convDot, %convDot%
Guicontrol ,,convMinus, %convMinus%
Guicontrol ,,convUnderscore, %convUnderscore%
Guicontrol ,,convPercent, %convPercent%
return

convert:
Iniread convDot, %iniFile%, convert, dots
Iniread convMinus, %iniFile%, convert, minus
Iniread convUnderscore, %iniFile%, convert, underscore
Iniread convPercent, %iniFile%, convert, percent
if convDot = 1
  StringReplace rawName, rawName, ., %A_SPACE%, A
 
if convMinus = 1
  StringReplace rawName, rawName, -, %A_SPACE%, A
 
if convUnderscore = 1
  StringReplace rawName, rawName, _, %A_SPACE%, A
 
if convPercent = 1
  StringReplace rawName, rawName, `%20, %A_SPACE%, A
return

ChangeCMI:
RegRead, regTest, HKEY_CLASSES_ROOT, *\shell\FileNanny
transform,eperluette,chr,0x26
Inputbox newCMI, Enter new context menu text, Please choose the text that will appear in the context menu., , , , , , , , %regTest%
If ErrorLevel
{
  return
}
else
{
  RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny, , %newCMI%
  Guicontrol,, currentCMI, Current : %newCMI%
}
return

AddCMI:
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny, , FileNann&y !
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny\command, , "%A_ScriptFullPath%" "`%L"
Guicontrol,, CMIb, Remove context menu item
Guicontrol +gremCMI, CMIb
Guicontrol,, currentCMI, Current : FileNann&y !
Guicontrol enable, CMIc
return

RemCMI:
RegDelete HKEY_CLASSES_ROOT, *\shell\FileNanny
Guicontrol,, CMIb, Add context menu item
Guicontrol +gaddCMI, CMIb
Guicontrol,, currentCMI, Current : n/a
Guicontrol disable, CMIc
return

addST:
FileCreateShortcut, %A_ScriptFullPath%, %sendToFolder%\filenanny.lnk
Guicontrol,, STb, Remove 'Send to' shortcut
Guicontrol +gremST, STb
return

remST:
FileDelete, %sendToFolder%\filenanny.lnk
Guicontrol,, STb, Add 'Send to' shortcut
Guicontrol +gaddST, STb
return

Quit:
GuiClose:
GuiEscape:
  ExitApp
return

« Last Edit: April 10, 2008, 05:23 AM by ak_ »

nosh

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,441
    • View Profile
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #73 on: April 10, 2008, 04:00 AM »
That's awesome, ak_! :up: Thanks!

Edit: The version numbers are now left untouched, as intended, but I'm getting slightly strange behavior reg. replacing underscores with spaces. It replaces underscores if the target file is in D:\Tools, where I have the FileNanny executable. The underscores aren't replaced if the target file is at another location (including D:\). I even did a system restart to make sure it was the latest version in operation. Is this something to do with the .ini variables being local to that folder only?

Just to clarify, I'm perfectly happy with the app now that version numbers are untouched, this is simply feedback.
« Last Edit: April 10, 2008, 05:00 AM by nosh »

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: IDEA: Create a containing folder by right clicking on a file
« Reply #74 on: April 10, 2008, 05:23 AM »
Glad you like it nosh, and thanks a lot for the feedback. I ran all my tests with files within the FileNanny folder, that's why i never spotted this bug. It's corrected now :)