New topic: Batch copies path field/browse button problem.
<http://forums.realsoftware.com/viewtopic.php?t=24931> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message brianheibert.com Post subject: Batch copies path field/browse button problem.Posted: Thu Oct 23, 2008 1:12 pm Joined: Thu Jan 25, 2007 7:38 pm Posts: 371 Location: Loveland, OH USA Hi, I am trying to make my CopyMate application do more than one Copy or Move at the same time. I am using the code below to create new CopyMate windows. Code: dim copier as CopyMate copier = new CopyMate Return True The problem I am running into is when Browse is clicked and the user selects a original file and clicks the other Browse button and selects a duplicate file it changes the first window's selection I want to be able to have the Browse button change the edit field's in the window Browse was clicked on Not all windows, right now if I click Browse it not only changes the edit fields in the main window but if there is another window open that was opened by the new command it changes those too. I want to be able to change only the window that the browse button was clicked on. Any ideas? This code is in the BrowseDuplicate method Code: dim f as folderItem dim path as string dim duppath as string f = GetOpenFolderItem (opentypes.SpecialDisk+opentypes.SpecialFolder+opentypes.Any) if f<> nil then path = f.absolutepath duppath = path CopyMate.DuplicateFilePath.text = duppath else MSGBOX "File not found or No file selected." end if This code is in the BrowseOriginal method Code: dim f as folderItem dim path as string dim origpath as string f = GetOpenFolderItem (opentypes.SpecialDisk+opentypes.SpecialFolder+opentypes.Any) if f<> nil then path = f.absolutepath origpath = path CopyMate.OrigFilePath.text = origpath else MSGBOX "File not found or No file selected." end if This code is in the copy method: Code: dim original as string dim copy as string dim sysversion as integer dim myOSErr as Boolean myOSErr =system.gestalt("sysv",sysversion) dim origc as folderitem dim copyc as folderitem origc = GetFolderItem(CopyMate.OrigFilePath.text) copyc = GetFolderItem(CopyMate.DuplicateFilePath.text) original = origc.ShellPath copy = copyc.shellPath if original = "" and copy = "" or original = "" or copy = "" then MSGBOX "No file path found. Please re-enter a original file path and a copy file path. Then try again." Exit end if If TargetMacOS and sysversion >1040 then dim copyshell as shell copyshell = new Shell copyshell.execute "ditto "+original+" "+copy MSGBOX "File: "+original+ " copied as: "+copy dim ShowCursor as New Modules.CPMModule.Cursors ShowCursor.StandardCursor else MSGBOX "CopyMate requires MacOS X (v10.4.x or higher)." quit end if This code is in the move method: Code: dim ShowCursor as New Modules.CPMModule.Cursors ShowCursor.WaitCursor dim original as string dim copy as string dim sysversion as integer dim myOSErr as Boolean myOSErr =system.gestalt("sysv",sysversion) dim origc as folderitem dim copyc as folderitem origc = GetFolderItem(CopyMate.OrigFilePath.text) copyc = GetFolderItem(CopyMate.DuplicateFilePath.text) original = origc.ShellPath copy = copyc.shellPath if original = "" and copy = "" or original = "" or copy = "" then MSGBOX "No file path found. Please re-enter a original file path and a copy file path. Then try again." Exit end if If TargetMacOS and sysversion >1040 then dim copyshell as shell copyshell = new Shell copyshell.execute "ditto "+original+" "+copy copyshell.execute "rm "+original MSGBOX "File: "+original+ " moved as: "+copy ShowCursor.StandardCursor else MSGBOX "CopyMate requires MacOS X (v10.4.x or higher)." quit end if _________________ Brian Heibert http://www.brianheibert.net [EMAIL PROTECTED] Top mrebar Post subject: Re: Batch copies path field/browse button problem.Posted: Thu Oct 23, 2008 1:37 pm Joined: Wed Feb 15, 2006 1:30 pm Posts: 2229 Location: U.S.A (often) Spokane, Eugene, Pago Pago You've got a couple points of confusion, but I'll attempt to answer your question. Concretely, get rid of CopyMate. in your code that resembles this... Code:CopyMate.DuplicateFilePath.text = duppath Michael Top brianheibert.com Post subject: Re: Batch copies path field/browse button problem.Posted: Fri Oct 24, 2008 1:45 pm Joined: Thu Jan 25, 2007 7:38 pm Posts: 371 Location: Loveland, OH USA got it working thanks Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 900 classes with 18000 functions in one REALbasic plug-in. The Monkeybread Software Realbasic Plugin v8.1. <http://www.monkeybreadsoftware.de/realbasic/plugins.shtml> [email protected]
