Jump to content

Oyvind Odegard

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by Oyvind Odegard

  1. I found a script here http://www.tek-tips.com/faqs.cfm?fid=5515 that I modified a bit. "strDir = " & Quote($path) &" ¶ Set FSO = CreateObject("Scripting.FileSystemObject")¶ Set objShell = CreateObject("WScript.Shell")¶ Set objDir = FSO.GetFolder(strDir)¶ getInfo(objDir)¶ ¶ Sub getInfo(CurrentDir)¶ For Each Item In CurrentDir.SubFolders¶ If Left(Cstr(Item.name),7)=" & Quote($Folder) & " Then¶ objshell.run "cmd /c explorer.exe """ & Item.path & """"¶ End If¶ Next¶ End Sub¶ " $path and $Folder are variables from the record. Oyvind
  2. After trying to bend my brain around more and more complex FM scripting, I decided to at least have a look at VBS - and lo and behold - it wasn't as hard as I had feared. It works perfectly now I can post a copy of the script if anyone is interested. Oyvind
  3. Thank you very much Søren! Those links were very useful, hopefully I'll report my success in a few days. Oyvind
  4. I have a problem that possibly has more than one solultion, and would be most grateful for any comments or ideas on what would be the best way to solve it. I have a database where every record has a unique number (year + serial 000-999) e.g. 2008186. The records correspond to folders in a known location on a HDD. The foldernames all start with the number + keywords that are entered on creation by users. For instance "2008186 shipwreck dredging North Sea". The folders contain all documents pertaining the respective records in the DB (FMP9). I have made a button "go to folder", with a send event script that finds the directories of the folders and should open the folder in explorer. But - as the DB only knows the number-part of the foldername, and not the keywords - the script won't work. I have looked for a batch command for the "Tab - autocomplete" function in the (WIN XP) cmd.exe, but no success so far. No two folders start with the same number, so this should work at least in theory. One obvious solution is to rename all folders to the number only, but unfortunately that is not possible as the keywords are used for browsing folder directories manually as well. I guess VBS is a viable way to go, but as I have very limited VBS knowledge I was hoping there was a simpler solution. For instance maybe could FM read a folder directory and find/match foldername to the unique recordnumber, or something...? I hope my explanation of the problem makes sense... Any ideas or comments? Oyvind Odegard
  5. Thank you, I will certainly use it! My scripts tend to be long and not very sexy Oyvind
  6. I know, but this DB is supposed to replace an existing DB where mouse wheel scrolling is enabled. And the end users specifically asked for it. But I think I have solved the problem now, using the FrontTab function http://www.briandunning.com/cf/692 as a control for whether to run the tabscripts or not: Let ($Num = Kategori; If( $Num = Left(FrontTab;4); ""; Case ( $Num="Tab1"; zippScript_PerformScript( Get(FileName); "Tabscript1"); $Num="Tab2"; zippScript_PerformScript( Get(FileName); "Tabscript2"); $Num="Tab3"; zippScript_PerformScript( Get(FileName); "Tabscript3"); $Num="Tab4"; zippScript_PerformScript( Get(FileName); "Tabscript4")))) And this seems to work just fine. Now I'll just wait for the next pit fall, and call for help again Thanks again! Oyvind
  7. Ah, I see now that I wrote earlier that I would disable status area and navigate by scripts. As it turns out I need to be able to scroll records using the mouse wheel, hence the need for zippscript to change tabs by calculation. I don't think it is possible to trigger scripts with the mouse wheel (is it?). When I said scrolling earlier, I really ment mouse wheel scrolling. Apologize not being more precise. I still need some advice on the triggerfield recalculating and causing the "go to tab" script stacking up. Appreciate all help so far!
  8. I've been searching the forum now for info on scripting and scrolling records. Could you please point me in the right direction? If it is possible to scroll through records and have the tabs change for each record without using a plug-in it would be great! Thank you for taking time to help me out on this!
  9. There are four tab-panes, the picture shows three of them. I've outlined the tabs with red - they are not visible in the original layout. The DB is an archaeological catalogue btw :)
  10. That won't work if you scroll through records, or if you perform a find will it?
  11. tabscript2: Go to object [objectname: "tab2"] You are right. If I disable all other calculated fields in the table it works just fine. Any way around it you think? Oyvind
  12. Hi, I guess my last exclamation was a bit premature. I use the zippscript plug-in as you recomended, and control the tabs with to fields. The field "Kategori" is set by a "new record"-script to 1,2 3 or 4 - depending on what kind of record is chosen. The other field "Kat_num" is a calculation field with the following calculation: Let ($Num = Kategori; Case ( $Num=1; zippScript_PerformScript( Get(FileName); "Tabscript1"); $Num=2; zippScript_PerformScript( Get(FileName); "Tabscript2"); $Num=3; zippScript_PerformScript( Get(FileName); "Tabscript3"); $Num=4; zippScript_PerformScript( Get(FileName); "Tabscript4"))) The tabscripts are simple "go to object" scripts. This solution does what it is intended to do, and I always get the correct tab when navigating between records or layouts. The problem is that the "Kat_num" field is recalculated on a seemingly whimsical basis, and very often two,three or four consecutive times (monitored as four instances of "tabscript2" as active scripts in the script debugger). This causes the screen to "flicker" as the layout is re-rendered, and even more irritating causes the cursor to jump out of its active field and go to the first field in the tab order. This happens when changing layouts, tabbing between fields or deleting a record - but not always. The "Kat_num" field is set not to store and recalculate when needed. Seemingly for some reason Filemaker finds it necessary to recalculate when it shouldn't need to. Anybody know what triggers the need to recalculate? Any tips or ideas on how to fix this problem would be much appreciated! Oyvind
  13. Works like a charm! Thanks again, Oyvind
  14. Thank you very much! I'll go trough it thoroughly, but at first look it seems to be what I need. I was hoping to avoid installing plug-ins on all clients, but I guess there is no way around it. Cheers Oyvind
  15. Thank you Stanley, that is a good tip, but how to trigger it for each record? For instance while scrolling in browse mode or within a found set? I'll hide the status area and do my own scripts for navigating, but I'd like to keep the scrolling ability if possible. -Oyvind
  16. Hi, Great forum! I have a question I hope someone can answer. I have a layout with a TCO with four panes, each pane representing one of four categories. I have four "new record" buttons, one for each category - and a script that shows the relevant pane accordingly. What I would like is to have FM automatically switch to the relevant panes while browsing records. Is this possible? Oyvind Odegard
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.