AutoHotkey Community

It is currently May 26th, 2012, 7:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Attributizer
PostPosted: May 25th, 2009, 8:27 pm 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
Attributizer - Current Version is v0.60

Back over in this thread, I asked for help with a small project of mine. Now, I've expanded it into a program that I think I should share.

It's simple: Attributizer can quickly change the attributes of a file or folder. Although it you can make a file or folder Read-Only or Hidden through its Properties dialog, this program simplifies the process in an easy GUI, and it supports the System attribute as well.

It's not a big deal, but it's my first big thing, and I feel kinda proud of it :D

Screenshots:
Image
Image

Download it here (Version 0.60)


Last edited by Mio on July 6th, 2009, 4:49 am, edited 8 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2009, 10:38 am 
Offline

Joined: February 23rd, 2009, 12:14 pm
Posts: 31
Location: Netherlands
Sure a nice handy program with a nice GUI. :D

Personally I'd really appreciate the possibilty to change the filedates/-times (Created, Modified, Accessed) as well. Perhaps a good idea? :)

Greetings,

Marc


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2009, 3:27 pm 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
Hmm, sounds interesting. I think I might include that too.

However, I recently learned of a bug in the program. I tried using it on my friend's Vista computer, but the installer wouldn't boot, and when I tried to run the script on it's own, it would open the GUI, but it wouldn't change the attributes of any files.

If anyone else has Vista, can they please give me feedback?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2009, 4:23 pm 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
MarcInSpace wrote:
Sure a nice handy program with a nice GUI. :D

Personally I'd really appreciate the possibilty to change the filedates/-times (Created, Modified, Accessed) as well. Perhaps a good idea? :)

Greetings,

Marc


Here is my prototype GUI
Image

I think it looks pretty functional. I'm going to make it so you can click the statusbar to switch between it showing the selection's main attributes and its date-related attributes.


Last edited by Mio on July 5th, 2009, 10:15 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2009, 6:06 pm 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
Finished :)

Image

Please test it out (especially on Vista) and tell me if it works


Last edited by Mio on July 6th, 2009, 4:50 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2009, 3:09 pm 
Offline

Joined: August 14th, 2007, 12:11 pm
Posts: 86
nice script it remindes me of one of my first script that uses windows attributes commands

Code:
#notrayicon
AGB_LoadIconDll(btn1, "shell32.dll", 4)
Gui, Add, Edit, x6 y27 w320 vfolder ,
Gui, Add, Button, x336 y27 w30 gbrowse2, &...
AddGraphicButtonGui("cauta", btn1, "x371 y27 w25 gbrowse")
Gui, Add, Button, x406 y27 w100 gexecuta, Execute
Gui, Add, CheckBox, x6 y57 h30 vs, System
Gui, Add, CheckBox, x86 y57 h30 vh, Hidden
Gui, Add, CheckBox, x166 y57 h30 vr, Read-only
Gui, Add, CheckBox, x246 y57 h30 va, Archive
Gui, Add, CheckBox, x326 y57 h30 vincdir, Include subdir
Gui, Add, CheckBox, x426 y57 h30 vincf, Include files
Gui, Add, Text, x16 y7 w440 h20 , Chose the file/folder you wish to modify
Gui, Show, h81 w530, Attribute Modifier
Return

GuiClose:
ExitApp

browse:
FileSelectFolder, folder1
if folder1 =
    return
else
guicontrol,enable,incdir
guicontrol,enable,incf
guicontrol,,s,0
guicontrol,,r,0
guicontrol,,h,0
guicontrol,,a,0
guicontrol,,folder,%folder1%
Random, rand , 10000, 9999999
text=attrib "%folder1%" > %a_temp%\%rand%.txt
fileappend,%text%, %a_temp%\%rand%.cmd
runwait,%a_temp%\%rand%.cmd,,hide
FileRead, read, %a_temp%\%rand%.txt
StringReplace, read, read, %folder1%,, All
StringReplace, read, read, %a_tab%,, All
StringReplace, read, read, %a_space%,, All
filedelete %a_temp%\%rand%.cmd
filedelete %a_temp%\%rand%.txt
IfInString, read, S
guicontrol,,s,1
IfInString, read, R
guicontrol,,r,1
IfInString, read, H
guicontrol,,h,1
IfInString, read, A
guicontrol,,a,1
return

executa:
gui,submit,nohide
if folder=
return
if s=1
sys=+s
if r=1
readonly=+r
if a=1
archive=+a
if h=1
hidden=+h
if s=0
sys=-s
if r=0
readonly=-r
if a=0
archive=-a
if h=0
hidden=-h

if incdir=1
incldir=/d
if incf=1
{
inclf=/s
ifn=\*
}
Random, rand , 10000, 9999999
text=attrib "%folder%%ifn%" %sys% %readonly% %archive% %hidden% %incldir% %inclf% > %a_temp%\%rand%.txt
fileappend,%text%, %a_temp%\%rand%.cmd
runwait,%a_temp%\%rand%.cmd,,hide
FileRead, read, %a_temp%\%rand%.txt
StringReplace, read, read, %folder1%,, All
StringReplace, read, read, %a_tab%,, All
StringReplace, read, read, %a_space%,, All
filedelete %a_temp%\%rand%.cmd
filedelete %a_temp%\%rand%.txt
IfInString, read, S
guicontrol,,s,1
IfInString, read, R
guicontrol,,r,1
IfInString, read, H
guicontrol,,h,1
IfInString, read, A
guicontrol,,a,1
return

browse2:
FileSelectFile, folder1, 3, , Open a file
if folder1 =
    return
else
guicontrol,,s,0
guicontrol,,r,0
guicontrol,,h,0
guicontrol,,a,0

guicontrol,,incdir,0
guicontrol,,incf,0
guicontrol,disable,incdir
guicontrol,disable,incf

guicontrol,,folder,%folder1%
Random, rand , 10000, 9999999
text=attrib "%folder1%" > %a_temp%\%rand%.txt
fileappend,%text%, %a_temp%\%rand%.cmd
runwait,%a_temp%\%rand%.cmd,,hide
FileRead, read, %a_temp%\%rand%.txt
StringReplace, read, read, %folder1%,, All
StringReplace, read, read, %a_tab%,, All
StringReplace, read, read, %a_space%,, All
filedelete %a_temp%\%rand%.cmd
filedelete %a_temp%\%rand%.txt
IfInString, read, S
guicontrol,,s,1
IfInString, read, R
guicontrol,,r,1
IfInString, read, H
guicontrol,,h,1
IfInString, read, A
guicontrol,,a,1
return

AddGraphicButtonGui(VariableName, ImgPath, Options="", bHeight=32, bWidth=32,gui=1){
Global
Local ImgType, ImgType1, ImgPath0, ImgPath1, ImgPath2, hwndmode
; BS_BITMAP := 128, IMAGE_BITMAP := 0, BS_ICON := 64, IMAGE_ICON := 1
Static LR_LOADFROMFILE := 16
Static BM_SETIMAGE := 247
Static NULL
SplitPath, ImgPath,,, ImgType1
If ImgPath is float
{
  ImgType1 := (SubStr(ImgPath, 1, 1)  = "0") ? "bmp" : "ico"
  StringSplit, ImgPath, ImgPath,`.
  %VariableName%_img := ImgPath2
  hwndmode := true
}
ImgTYpe := (ImgType1 = "bmp") ? 128 : 64
If (%VariableName%_img != "") AND !(hwndmode)
  DllCall("DeleteObject", "UInt", %VariableName%_img)
If (%VariableName%_hwnd = "")
  Gui,%gui%: Add, Button,  v%VariableName% hwnd%VariableName%_hwnd +%ImgTYpe% %Options%
ImgType := (ImgType1 = "bmp") ? 0 : 1
If !(hwndmode)
  %VariableName%_img := DllCall("LoadImage", "UInt", NULL, "Str", ImgPath, "UInt", ImgType, "Int", bWidth, "Int", bHeight, "UInt", LR_LOADFROMFILE, "UInt")
DllCall("SendMessage", "UInt", %VariableName%_hwnd, "UInt", BM_SETIMAGE, "UInt", ImgType,  "UInt", %VariableName%_img)
Return %VariableName%_img ; Return the handle to the image
}

AGB_LoadIconDll(ByRef VariableName, dllfile, nindex) {
Global
Local spid
spid := DllCall("GetCurrentProcessId")
If (%VariableName%_img != "")
  DllCall("DeleteObject", "UInt", %VariableName%_img)
VariableName := "1." . DllCall("shell32.dll\ExtractIconA", "UInt", spid, "Str", dllfile, "UInt", nindex)
Return ErrorLevel
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2009, 6:24 pm 
Offline

Joined: February 23rd, 2009, 12:14 pm
Posts: 31
Location: Netherlands
Thanks for the positive reply on my suggestion! :D

I think it is a really nice addition to the app.

However, perhaps I would be a good idea (?) to have 3 separate inputboxes (or calendar controls) for the 3 different dates/times, as well as an "Apply" or "Ok/Cancel" button? I now changed one of the dates by clicking one of the datetype buttons, assuming I was only switching to view that date! :lol: [My mistake, I know, but still somewhat confusing, perhaps.]

Greetings,

Marc


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 30th, 2009, 5:11 am 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
MarcInSpace wrote:
Thanks for the positive reply on my suggestion! :D

I think it is a really nice addition to the app.

However, perhaps I would be a good idea (?) to have 3 separate inputboxes (or calendar controls) for the 3 different dates/times, as well as an "Apply" or "Ok/Cancel" button? I now changed one of the dates by clicking one of the datetype buttons, assuming I was only switching to view that date! :lol: [My mistake, I know, but still somewhat confusing, perhaps.]

Greetings,

Marc


I understand, Marc. I'll try changing it up tomorrow.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 1st, 2009, 8:06 pm 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
Sorry it took so long, I was busy yesterday, but I finished it right now.
I added a confirmation dialog to each of the Date-related buttons. That dialog can be turned off if desired through a new Options menu as well.

Image


Last edited by Mio on July 6th, 2009, 4:50 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 1st, 2009, 8:13 pm 
Offline

Joined: June 5th, 2008, 8:26 pm
Posts: 38
I'm also currently looking for feedback for the following things.
    I don't really like how the times are displayed in the StatusBar (looks too cramped to me). Anyone have any suggestions?
    Screenshot to illustrate point:
    Image


    I still need feedback on the program running in Vista. I have a feeling it has something to do with Administrative privileges, but I'm not sure, and I can't test it since I don't have a Vista computer.
If anyone could help, it would be greatly appreciated.


Last edited by Mio on July 5th, 2009, 10:01 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: A couple of things.
PostPosted: June 19th, 2009, 4:04 am 
Offline

Joined: June 14th, 2008, 7:47 pm
Posts: 56
Location: Sydney, Australia
Hi,

Thanks I was looking for something like this.

I like the calendar control :-)

A couple of things.

1) Yeah, it looks a bit cramped, but I don't see much to do...
May be change:
Directory to Folder (and match button)
Atributtes to Atrib.

2) If you fell like v0.7 would be nice to have an option to recourse on SubFolders (inc SubFolders only, Sub-Files only or Both)
Note: files will look weird all with the same timestamp mod, but the same happens when burning CDs etc and burner settings are not to keep original timestamps.
For that you may use a checkbox etc and If you make your GUI a bit larger the status bar will also look better

I got exited with the feedback LOL
3) Have a second Status bar to be able to include all Nomal and Time atributtes.

Cheers, Yogui

_________________
Thanks, Yogui.
_____________________________


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: fusion1920, infogulch, Scratch and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group