Jump to content

JesseBarnett

Active Members
  • Posts

    22
  • Joined

  • Last visited

JesseBarnett's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Kind of sounds more like a ghost objects problem for the files to end up that big. Run a test. Open a dwg and select everything with a selection box and cut & paste into an empty drawing. Then go back to the supposedly empty drawing and ctrl A (Select All). Are there several thousand blue squares that show up? If they are there then purge doesn't get rid of them and there is no way to get rid of them. Only solution I found was to cut & paste into an empty drawing, leaving all of the trash behind.
  2. I need to be able to replicate selecting a file in Windows Explorer, right click & "Send To". "Send to" acts differently then "Open with" and I can't find what command or syntax to use.
  3. Thanks everyone!. crzftx's suggestion was what I needed to get it working. Now it works fine without having to create/delete the gui and the selected item stays selected until you select a different entry. I will be looking at dragging after I get the main script up and running. Also am trying to wrap my head around being able to select multiple items at one time. I will be adding in array boundary checks, I am new to Autoit but I learned from other languages to keep it simple until I get the basics working then add in more, one layer at a time. In this specific case, my main script is up around 800 lines, but I work in side scripts and then add it into the main script when it works. The only nasty surprise I had with this listview was adding in a second Case set which meant 2 different $GUI_EVENT_CLOSE. ExitLoop stopped the mother gui from processing the child gui $GUI_EVENT_CLOSE. I will also be looking at learning how to convert my main script over to onevent mode to see the difference. Func _listview() $child = GUICreate("Arrange Array", 200, 400) $listview = GUICtrlCreateListView("", 10, 10, 180, 350) GUISetState() _GUICtrlListView_AddColumn($listview, "Items", 100) $up = GUICtrlCreateButton("UP", 20, 370, 50, 20) $down = GUICtrlCreateButton("DOWN", 130, 370, 50, 20) $filecount = $array[0] For $incr = 2 To $filecount _GUICtrlListView_AddItem($listview, $array[$incr]) Next While 1 $Msg = GUIGetMsg() Switch $Msg Case $up $cnt = _GUICtrlListView_GetNextItem($listview) _ArraySwap($array[$cnt + 2], $array[$cnt + 1]) _GUICtrlListView_SetItemText($listview, $cnt, $array[$cnt + 2]) _GUICtrlListView_SetItemText($listview, $cnt - 1, $array[$cnt + 1]) _GUICtrlListView_SetItemSelected($listview, $cnt - 1, True) Case $GUI_EVENT_CLOSE GUIDelete($child) ExitLoop Case $down $cnt = _GUICtrlListView_GetNextItem($listview) _ArraySwap($array[$cnt + 2], $array[$cnt + 3]) _GUICtrlListView_SetItemText($listview, $cnt, $array[$cnt + 2]) _GUICtrlListView_SetItemText($listview, $cnt + 1, $array[$cnt + 3]) _GUICtrlListView_SetItemSelected($listview, $cnt + 1, True) EndSwitch WEnd EndFunc ;==>_listview
  4. Well I have it now so that I can move the selected item up or down in both the listview and the array. Is there a way to refresh the listview without having to delete and then rebuild the gui? Come on now, 46 views. someone, somewhere must have a helpfull tip. If someone wants to give it a try then just go to any folder with tif, jpg or pdfs, select several and open. #include <Array.au3> #include <GUIConstantsEx.au3> #include <ListviewConstants.au3> #include <GuiListView.au3> $_1 = GUICreate("Jesse's Plot Wizard", 395, 389, 325, 178) Local $filemenu, $exititem, $helpmenu, $infoitem $filemenu = GUICtrlCreateMenu("&File") $fileitem = GUICtrlCreateMenuItem("Open", $filemenu) $exititem = GUICtrlCreateMenuItem("Exit", $filemenu) GUISetState(@SW_SHOW) Local $_1_AccelTable[3][2] = [["^!+4", $filemenu],["{NUM 5}", $fileitem],["{UP}", $infoitem]] GUISetAccelerators($_1_AccelTable) $cnt = 0 While 1 Dim $nMsg = GUIGetMsg() Switch $nMsg Case $fileitem Dim $folder = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" $file = FileOpenDialog("", $folder, "Images (*.tif;*.jpg;*.pdf)", 1 + 4) $array = StringSplit($file, "|") If $array[0] = 1 Then $len = StringLen($folder) $trim = $len - StringInStr($folder, "\", 0, -1, $len) EndIf _ArraySort($array, 0, 2) _listview() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _listview() $child = GUICreate("Arrange Array", 200, 400) $listview = GUICtrlCreateListView("", 10, 10, 180, 350, $LVS_SINGLESEL) GUISetState() _GUICtrlListView_AddColumn($listview, "Items", 100) $up = GUICtrlCreateButton("UP",20,370,50,20) $down = GUICtrlCreateButton("DOWN",130,370,50,20) $filecount = $array[0] For $incr = 2 To $filecount _GUICtrlListView_AddItem($listview, $array[$incr]) Next _GUICtrlListView_SetItemSelected($listview, $cnt) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $up $cnt = _GUICtrlListView_GetNextItem($listview) _ArraySwap($array[$cnt + 2], $array[$cnt + 1]) $cnt -= 1 GUIDelete() _listview() Case $GUI_EVENT_CLOSE exit Case $down $cnt = _GUICtrlListView_GetNextItem($listview) _ArraySwap($array[$cnt + 2], $array[$cnt + 3]) $cnt += 1 GUIDelete() _listview() EndSwitch WEnd EndFunc ;==>_listview
  5. Well I have made progress but still not exactly where I want to be and need help. #include <Array.au3> #include <GUIConstantsEx.au3> #include <ListviewConstants.au3> $_1 = GUICreate("Jesse's Plot Wizard", 395, 389, 325, 178) Local $filemenu, $exititem, $helpmenu, $infoitem $filemenu = GUICtrlCreateMenu("&File") $fileitem = GUICtrlCreateMenuItem("Open", $filemenu) $exititem = GUICtrlCreateMenuItem("Exit", $filemenu) GUISetState(@SW_SHOW) Local $_1_AccelTable[3][2] = [["^!+4", $filemenu],["{NUM 5}", $fileitem],["{UP}", $infoitem]] GUISetAccelerators($_1_AccelTable) While 1 Dim $nMsg = GUIGetMsg() Switch $nMsg Case $fileitem Dim $folder = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" $file = FileOpenDialog("", $folder, "Images (*.tif;*.jpg;*.pdf)", 1 + 4) $array = StringSplit($file, "|") If $array[0] = 1 Then $len = StringLen($folder) $trim = $len - StringInStr($folder, "\", 0, -1, $len) EndIf _ArraySort($array, 0, 2) _listview() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _listview() $Form1 = GUICreate("Arrange Array", 200, 400) $listview = GUICtrlCreateListView("File ", 10, 10, 180, 350, $LVS_SINGLESEL,$LVS_EX_CHECKBOXES) $up = GUICtrlCreateButton("UP",20,370,50,20) $down = GUICtrlCreateButton("DOWN",130,370,50,20) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState() $incr = 2 $filecount = $array[0] While $incr <= $filecount GUICtrlCreateListViewItem($array[$incr], $listview) $incr += 1 WEnd GUISetState(@SW_SHOW, $Form1) While 1 Dim $nMsg = GUIGetMsg() Switch $nMsg Case $up $sel = GUICtrlRead(GUICtrlRead($listview),2) $sel = StringTrimRight($sel, 1) $cnt = _ArraySearch($array, $sel) _ArraySwap($array[$cnt], $array[$cnt - 1]) GUISetState(@SW_HIDE, $Form1) _listview() Case $GUI_EVENT_CLOSE exit EndSwitch WEnd EndFunc ;==>_listview This will move the highlighted item up one position everytime the up button is pushed. But I really need it to read the checked item instead of the highlighted item. Also hoping someone could point me to a way to refresh the listview and keep the selected item selected.
  6. I have all of the rest of my larger script working except for this function. Is there anyway to "drag" an item in a listview to change the order of the array? Among other things, my larger script needs to print out a selected set of pdf files in a set order such as: A1.pdf, A2.pdf, E1.pdf, E2,pdf, E3.pdf, B1.pdf, B2.pdf, 1.pdf, 2.pdf, 3.pdf etc. If it isn't possible to drag, then anyone have any other suggestions? #include <Array.au3> #include <GUIConstantsEx.au3> $_1 = GUICreate("Jesse's Plot Wizard", 395, 389, 325, 178) Local $filemenu, $exititem, $helpmenu, $infoitem $filemenu = GUICtrlCreateMenu("&File") $fileitem = GUICtrlCreateMenuItem("Open", $filemenu) $exititem = GUICtrlCreateMenuItem("Exit", $filemenu) GUISetState(@SW_SHOW) Local $_1_AccelTable[3][2] = [["^!+4", $filemenu],["{NUM 5}", $fileitem],["{UP}", $infoitem]] GUISetAccelerators($_1_AccelTable) While 1 dim $nMsg = GUIGetMsg() Switch $nMsg Case $fileitem dim $folder = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" $file = FileOpenDialog("", $folder, "Images (*.tif;*.jpg;*.pdf)", 1 + 4) $array = StringSplit($file, "|") If $array[0] = 1 Then $len = StringLen($folder) $trim = $len - StringInStr($folder, "\", 0, -1, $len) EndIf _ArraySort($array, 0, 2) _listview() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _listview() $Form1 = GUICreate("Arrange Array", 200, 300) $ListView1 = GUICtrlCreateListView("File ", 10, 10, 180, 280) $incr = 2 $filecount = $array[0] While $incr <= $filecount GUICtrlCreateListViewItem($array[$incr], $ListView1) $incr += 1 WEnd GUISetState(@SW_SHOW) EndFunc
  7. Any language and any program can be cracked with enough time and expertise, just take a look through any torrent site. Doesn't matter if it is any of the Microsoft products or even high end design programs that retail for $20K+. Most written by some really brilliant people, taking all the safeguards available. Take a look for how much Tekla X-Steel, Maya, 3D Studio Max, Autocad etc list for and yet someone, somewhere cracked em wide open. Code for fun and have fun coding. Autoit is a brilliant little language to learn.
  8. Autoit includes a cut down version of SciTE. Download the full version of SciTE seperately: http://www.autoitscript.com/autoit3/scite/downloads.shtml It includes a whole bunch more goodies!
  9. Just wanted to pop in and say THANK YOU, THANK YOU, THANK YOU!!! I started my scripting/coding journey in a round-a-bout way by starting with LSL (Second Life), very active in that forum helping others but am constrained by the platform limits. Just started with Autoit and have cobbled together a couple of programs which I am using at work. Next on my to-do list is C# and I am learning it in conjunction with Autoit and your unselfish posting of the C# source is helping tremendously.
  10. Couldn't get it to compile in XP until I inserted #Include <GuiComboBoxEx.au3> to define $CBS_DROPDOWNLIST
  11. Thanks Ludocus! I'll add it to my slowly expanding knowledge base.
  12. Looking back at my response, it looks kind of cold, which was not the intent. Just wanted to warn you that after being in several coding forums, that bad things usually happen when the request is worded like that. I am also just learning Autoit and wish I could help with your particular problem. It would be doubly hard to learn a new scripting language when English is just your secondary language. Only helpful I advice I could give is that it may be better to start a new thread with the title mentioning OCR & the author as herewasplato pointed out. Good luck and well wishes
  13. Anyway to use gdiplus or an alternative to get the info for a pdf? I have it working using the following code, but of course smaller would be better. $file = FileOpenDialog("Please select file", "", "Image files (*.jpg;*.tif;*.gif;*.bmp;*.png;*.pdf)"); RunWait("C:\Program Files\IrfanView\i_view32.exe " & $file & "/info=" & $file & ".txt") $dims = FileReadLine($file & ".txt", 6) $cnt = StringInStr($dims, "=") $dims = StringTrimLeft($dims, $cnt + 1) $cnt = StringInStr($dims, "P") $cnt = StringLen($dims) - $cnt $dims = StringTrimRight($dims, $cnt + 2) FileDelete($file & ".txt") MsgBox("","",$dims)
  14. This thread should help: http://www.autoitscript.com/forum/index.php?showtopic=2523
  15. New to this forum but very active with forums for other languages. Just wanted to point out that when you qualify who you want to reply to your post as in something like : "[ Pro's Only ;-) ]". All it does it usually piss people off including the "pro's" and 9 times out of 10 there is no response.
×
×
  • Create New...