
UTA
Active Members-
Posts
50 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by UTA
-
I did it by myself using jscript/Wscript. Just copy the code to a ".js" file and doubleclick it (windows) like an exe-file. var iTunesApp = WScript.CreateObject("iTunes.Application"); var mainLibrary = iTunesApp.LibraryPlaylist; var tracks = mainLibrary.Tracks; var numTracks = tracks.Count; var i; var currTrack; var TrackName; var AlbumName; var NewTrackName; var NewAlbumName; var Pos ; WScript.Echo("Library-Name : " + mainLibrary.Name + "(" + numTracks + " Tracks)"); WScript.Echo("====================="); WScript.Echo(""); WScript.Echo("Looking for \"]/\" ..."); WScript.Echo(""); for (i = 1; i <= numTracks; i++) { currTrack = tracks.Item(i); TrackName = currTrack.Name.toString(); Pos = TrackName.indexOf("]/"); if (Pos>0){ NewTrackName = TrackName.substring(0,Pos+1); WScript.Echo("Changing TRACKNAME of Track " + i + ": " + TrackName + " => " + NewTrackName); currTrack.Name = NewTrackName; } AlbumName = currTrack.Album.toString(); Pos = AlbumName.indexOf("]/"); if (Pos>0){ NewAlbumName = AlbumName.substring(0,Pos+1); WScript.Echo("Changing ALBUMNAME of Track " + i + ": " + AlbumName + " => " + NewAlbumName); currTrack.Album = NewAlbumName; } } But I'm pretty sure, this could be handy when porting something similar to your UDF... UTA
-
This UDF sounds great. But there isn't a way to update the song information (name, album-name, etc.), is it? I'm looking for any tool or any way to update the song-information of every song in my whole library. Reason is that many songs have stupid "extension" like "Club Can't Handle Me [Feat. David Guetta]/Feat. David Guetta" I don't need that twice. The same with the album names. I wan't to get rid of that and thought this UDF may help... Does anybody have an idea, how to handle this #&$! "extensions"? UTA
-
Hi, I use a _GUICtrlRichEdit in my prog. Unfortunately it is not possible to use the tab-key as a usual key to indent words or whole (more at once) lines. I tried to work around this by defining a accelerator-key (TAB) and insert it a @TAB-Character manually. But that does not work as it should, because when selecting more than one line at once not each line will be indented. Instead a @TAB will be inserted only in the next line (where the insertion point is in that moment). I can't imagine that there isn't any shorter or clever way to get usual behaviour of that key. That request can't be that rare (although the search does not give back any results)?! Does anybody know a way? UTA
-
GUICtrlSetResizing for _GUICtrlRichEdit does not work?
UTA replied to UTA's topic in AutoIt General Help and Support
Ahh, I see. Perfect. Thank you! - That works like a charm. UTA -
Hi everybody, I do use a _GUICtrlRichEdit-Control in my script. The GUI is resizeable and the RichEdit-control should always fill out the GUI-clientsize. I tried it by using GUICtrlSetResizing($hRichEdit, $GUI_DOCKAUTO) but that doesn't seem to work. See this example code from the helpfile expanded by an editfield which resizes correctly. Why isn't the RichEdit-control behave like the edit-field? #AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GuiRichEdit.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Main() Func Main() Local $hGui, $hRichEdit, $iMsg $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName,4) &")", 320, 350, -1, -1, BitOr($WS_SIZEBOX, $WS_SYSMENU)) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) GUICtrlSetResizing($hRichEdit, $GUI_DOCKAUTO) $Edit = GUICtrlCreateEdit("This is a edit field", 10, 240, 300, 80) _GUICtrlRichEdit_AppendText($hRichEdit, @CR & "This is more text") GUISetState() While True $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE GUIDelete() Exit EndSelect WEnd EndFunc ;==>Main At the moment I use the GUI-message-loop checking the GUI-Size and change the richedit-size if required as a workaround. But this is a very dirty workaround because during the resizing process (while dragging a border of the GUI) the richedit control doesn't yet change the size. It will be done after the resizing process is finished.... ugly... UTA
-
Absolutely perfect for my needs. To be honest, I tried exactly such a workaround already in this function. But obviously at the wrong line number (later) where it didn't work and I wondered why... so I despaired. Bu thank you it works now and I am happy!!! Thank you! UTA
-
Bump! Perhaps someone has an idea how to work around the task in a simple but clever way? UTA
-
I use the example of GaryFrost in THIS thread to open up a context menu when a treeview item is rightclicked. This menu contains also the possibility to add a new item. Everything works fine. BUT: I read the treeview-items dynamically from an INI-file and there could be the situation that no items are existing. Then it should be possible for the user to add a new item by opening up the contextmenu and choose "new item". But with this code above no contextmenu is apearing. How can I do this? UTA
-
I'm not sure if I understand. You mean it's self-induced??? I still can't get it... All I understand is that the first Section ($Section[1]) has the handle/control-ID "4". But I would expect that the item-index (NOT the handle/control-ID) depends on the position in the treeview. Because the position of an item in a treeview could change for instance while the handle should stay always the same, right? UTA
-
Hi everybody, I'm playing around with a treeview object. But the items in the treeview seem to start at index 4? And I neither know why nor if they begin always at 4. My Prog: #Region Includes #include <GUIConstantsEx.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #Include <GuiTreeView.au3> #EndRegion Includes #Region Definitions $ExeFullPath = @ScriptDir & "\" & StringRegExpReplace(@ScriptFullPath, "^.*\\|\..*$", "") & ".exe" $INIFullPath = @ScriptDir & "\" & StringRegExpReplace(@ScriptFullPath, "^.*\\|\..*$", "") & ".ini" Dim $SectionHandles[1] Dim $ItemHandles[1] #EndRegion Definitions #Region GUI $Main = GUICreate("Treeview", 201, 461, 0, 0, BitOR($WS_SIZEBOX,$WS_THICKFRAME,$WS_POPUP,$WS_BORDER, $WS_CAPTION)) $TreeView1 = GUICtrlCreateTreeView(0, 0, 200, 460, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_NOSCROLL)) $SectionNames=GetCategories() If $SectionNames[0]>0 then ReDim $SectionHandles[$SectionNames[0]+1] $SectionHandles[0]=$SectionNames[0] For $i=1 To $SectionNames[0] ; create Category $SectionHandles[$i]=GUICtrlCreateTreeViewItem($SectionNames[$i], $TreeView1) ; create Category-Items $ItemNames=GetCategoryItems($SectionNames[$i]) If $ItemNames[0][0]<>-1 then ReDim $ItemHandles[$ItemNames[0][0]+1] $ItemHandles[0]=$ItemNames[0][0] For $j=1 To $ItemNames[0][0] $ItemHandles[$j]=GUICtrlCreateTreeViewItem($ItemNames[$j][0], $SectionHandles[$i]) Next EndIf Next EndIf GUISetState(@SW_SHOW) #EndRegion GUI #Region GUI-MessageLoop While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE SaveIt() Exit EndSwitch WEnd #EndRegion GUI-MessageLoop #Region Functions Func GetCategories() local $SectionArray[1] If FileExists($INIFullPath) Then $SectionArray=IniReadSectionNames($INIFullPath) ; delete Options-Section (not necessary) local $Options=_ArraySearch($SectionArray, "OPTIONS") If $Options>0 then _ArrayDelete($SectionArray, $Options) If IsArray($SectionArray) Then $SectionArray[0]-=1 Else local $SectionArray[1] $SectionArray[0]=-1 EndIf Else ReDim $SectionArray[1] $SectionArray[0]=-1 EndIf Return $SectionArray EndFunc Func GetCategoryItems($CategoryName) local $ItemArray[1][1] $ItemArray=IniReadSection($INIFullPath, $CategoryName) If @error=1 then $ItemArray[0][0]=-1 Return $ItemArray EndFunc Func SaveIt() ConsoleWrite("Treeview contains " & _GUICtrlTreeView_GetCount($TreeView1) & " elements" & @CRLF) If _GUICtrlTreeView_GetCount($TreeView1)>0 Then ConsoleWrite("Index-First-Item: " & _GUICtrlTreeView_Index($TreeView1, _GUICtrlTreeView_GetFirstItem($TreeView1)) & @CRLF) For $i=0 To 15 ConsoleWrite($i & "/" & _GUICtrlTreeView_GetItemHandle($TreeView1, $i) & ": " & _GUICtrlTreeView_GetText($TreeView1, _GUICtrlTreeView_GetItemHandle($TreeView1, $i)) & @CRLF) Next EndIf EndFunc #EndRegion Functions There should be a .ini-file with the same name as the script-name (e.g. "test.au3" <=> "test.ini") and look similar to this: [OPTIONS] Option1=99 [General] About=1 [DISPLAY] Resolution=2 Other=3 [Test] what=4 Why are the items beginning at index 4 (see the console after closing) ??? UTA
-
Hi GaryFrost, I have the same error: Error _GUIImageList_AddIcon: -1 UTA
-
I do have a similar/the same problem. With this code ... #include <Array.au3> #region outside of func $m="blablablablabla" #endregion Func erez() #Region test-for-fold sleep (2000) #endregion If $x = 1 Then $x = 2 EndIf EndFunc I would expect after clicking "View" => "Toggle all folds" that it toggles all folds. But it doesnt. Only the first level is toggled. If I click manually on the func-level-fold while holding the Ctrl-Key it does exactly what I expect. Is there a way to change the "standard" behaviour of SciTE to what it promises ("toggle all folds") without the need of clicking all folds manually? UTA
-
Perfect! Thank you very, very much.
-
Oh perfect, works like a charm for any file-extension. Together with your Icons.au3 the painted results are perfect. But what have to be done, if I want to get the defaulticon for a Path (e.g. directory or drive) ? _WinAPI_AssocQueryString together with a file-extension isn't possible - I don't have an extension... The other possibilities for the parameter "$sAssoc" doesn't mean anything to me EDIT: I could use your idea with SHGETFILEINFO of the first post, but it wouldn't feel like a neat solution (to use AssocQueryString on file and SHGetFileInfo on Paths). UTA
-
Did you come to solution for this problem? I have the exactly the same problem of how to extract the associated icon in a bigger size. I would be very interested in a solution (if there is one). UTA
-
Exactly! I'm sure it will work on Vista 64bit also, I just wanted to mention that I'm NOT sure what it will do on XP...For me it's strange too, but very handy at the moment UTA
-
Just add this to the top of your functions: #include <GUIConstants.au3> #include <WindowsConstants.au3> $Struct = DllStructCreate("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;") $sStruct = DllStructCreate("dword;int;ptr;int") $GUI = GUICreate("Windows Vista DWM", 243, 243, -1,-1, $WS_POPUP) GUISetBkColor(0x0000CC) ; just for better visibility of the forms client area $Icon = GUICtrlCreateIcon(@WindowsDir & "\explorer.exe",0, 10, 10, 32, 32) $Apply = GUICtrlCreateButton("Apply", 80, 104, 83, 25, 0) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE, $Icon Exit Case $Apply If _Vista_ICE() Then _Vista_ApplyGlass($GUI, 0x000000) EndIf EndSwitch WEnd edit: ähm.. by the way - This works for Vista 32bit and Win 7 64bit for me. But I didn't test it on other OSs... UTA
-
Perhaps it's not a groundbreaking information for all of you but I was surprised that the _Vista_ApplyGlass-Function applied on a $WS_POPUP-Form leads to a transparent Form where only the controls stay visible. I didn't know that nor do I know enough to explain it - But for me it comes in handy at the moment. I'm already working with that additional "feature" since two weeks UTA
-
OK, but this is my argumentation: I used the inbuilt internal function to convert icons to bitmaps, resize bitmaps and convert bitmaps to icons again. The new code of your _SetHIcon-function is the following: Func _SetHIcon($hWnd, $hIcon, $iWidth = -1, $iHeight = -1, $hOverlap = 0) Local $hBitmap $hWnd = _Icons_Control_CheckHandle($hWnd) If $hWnd = 0 Then Return SetError(1, 0, 0) EndIf _Icons_Control_CheckSize($hWnd, $iWidth, $iHeight) If Not ($hOverlap < 0) Then $hOverlap = _Icons_Control_CheckHandle($hOverlap) EndIf $hBitmap=_Icons_Bitmap_CreateFromIcon($hIcon) $hBitmap=_Icons_Bitmap_Resize($hBitmap, $iWidth, $iHeight) $hIcon = _Icons_Icon_CreateFromBitmap($hBitmap) If $hBitmap Then _WinAPI_DeleteObject($hBitmap) EndIf If Not _Icons_Control_SetImage($hWnd, $hIcon, $IMAGE_ICON, $hOverlap) Then If $hIcon Then _WinAPI_DestroyIcon($hIcon) EndIf Return SetError(1, 0, 0) EndIf Return 1 #cs ;Original Code of this function: $hWnd = _Icons_Control_CheckHandle($hWnd) If $hWnd = 0 Then Return SetError(1, 0, 0) EndIf If Not ($hOverlap < 0) Then $hOverlap = _Icons_Control_CheckHandle($hOverlap) EndIf $hIcon = _Icons_Icon_Duplicate($hIcon) If Not _Icons_Control_SetImage($hWnd, $hIcon, $IMAGE_ICON, $hOverlap) Then If $hIcon Then _WinAPI_DestroyIcon($hIcon) EndIf Return SetError(1, 0, 0) EndIf Return 1 #ce EndFunc ;==>_SetHIcon It's not quite a stretch, I know. And it's absolutely not that smooth as it is with _SetIcon (compared the quality is worse) but it's working. And at the moment I wouldn't want to miss the possibility to work the same way _SetIcon does (resize it, if necessary), if there is no need to. But maybe there is a better/smoother idea of the "how to resize" somewhere? Does anybody of you have such an idea? UTA
-
Excellent work and searched very often in the past. Now any search is over. But while playing around a bit and recognizing the huge quality-difference between GUICtrlCreateIcon and your _SetIcon-Function: What are the reasons that the _SetIcon-Function is able to resize the icon to a specified size BUT _SetHIcon is NOT ? I guess it's not possible to resize it with the _SetHIcon-Function (because you sure have thought about that) but its hard to believe... ?! And damn, I'm not able to prove otherwise. UTA
-
Aaaarg... of course! Thanks Jos! Sometimes I don't see the wood for the trees... UTA
-
Hi everybody, I was wondering if it is possible to creat controls in a loop (dynamically) and afterwards to address them dynamically. Imagine I want to create a (dynamic) number of icons next to each other. Later (in the sourcecode) I would like to address them dynamically the same way. Something like the following (but that doesn't work): Creation... For $i=1 to $NumberIcons $Icon & $i = GUICtrlCreateIcon($i & ".ico",0, $i-1*$IconSize+2, 2, $IconSize, $IconSize) Next Address... For $i=1 to $NumberIcons GUICtrlSetImage($Icon & $i, $i & ".ico") Next Is that possible somehow with autoit? UTA
-
This code is perfect for a splashscreen. But how do I get it work with some more transparent PNGs on the gui? At the moment the form is resized to the bitmap-size. 1) But what if I want to have more than one bitmap? 2) Also I tried WinAPI_UpdateLayeredWindow($hWnd, $hDC, 0, 0, $hMemDC, DllStructGetPtr($tSource), 0, DllStructGetPtr($tBlend), $ULW_ALPHA) like it is mentioned in the helpfile but that doesn't work. 2a) How can i prevent the form to resize itself to the bitmap-size without loosing transparency? 2b) Or how is it possible to resize it to a fixed (bigger) size than the bitmap without loosing transparency? UTA
-
While playing around with your CompareArray-Function (Thanks for that) I stumbled across one little mistake: I would replace Local $iTotal = ($minX-1) * ($minY-1) with Local $iTotal = ($minX) * ($minY) instead. Otherwise I got a difference of more than 100% if everything is different . UTA
-
How to read and write ID3 tags in MP3 files
UTA replied to Pauletp's topic in AutoIt General Help and Support
I did that but did not find one which would WRITE the data into ID3v2.