Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Location

michael_w's Achievements


Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges



  1. Thanks - at least I know now that it won't work. Cheers Michael
  2. Hi - I've been battling with this all day and I just can't figure it out. I have a DB with 3 tables all linked via an account name field. The DB is split into UI and data files (separation model) and in the data file I have joined the tables via the account name field and allow creation of related fields both ways. When I go to tab Transactions in the UI file and add a new transaction in the portal (see record with ID 118) with an account name that does not exist (Card 3) I would have expected it to create a new record not only in the transactions data table but also in the groups and accounts tables. Why is it not working - I can't figure it out. I have attached a scaled down copy of my DB. accounts.zip
  3. Sussed it - excellent comment, thanks for your help My problem was that I hand't put the unique field into the first portal row. Instead I had placed it just on the tab outside the portal. Many thanks to everyone contributing - it's good to know that one isn't alone...
  4. Sorry comment - I had overlooked your attachment. Yes, I tried it and it does select the right tab when I press the buttons - cool : I need to study your solution a bit more before I understand how it works.
  5. ... I keep playing with it and even though I'm still doing what I've done so far, i.e. Go to Field followed by Go to Row 1 it now jumps to the 1st row of tab Accounts which doesn't share the same portal. Before it was jumping to the tab Overview which at least hared the same portal to the table t.Transactions with the Transactions tab, but now?:
  6. Hi John - I'm already doing that. The field k.Transactions is unique to the Transactions tab where I want to remain. I can see the script selecting that field but the subsequent Go to Row step makes it jump to the Overview tab again. I also tried it with a repeating field - no change :
  7. Hi IdealData - are you talking about the same thing? Your explanation seems more applicable to navigating from one field to another using the tab key, but I was referring to tabbed portals.
  8. Thanks David. I have the following (as this DB is work in progress some tabs are empty): tab Files - empty tab Groups - empty tab Accounts - portal to table t.Accounts and some global fields from local table t.AccountsUI tab Units - portal to table t.Units and some global fields from local table t.AccountsUI tab Overview - portal to table t.Transactions and some global fields from local table t.AccountsUI plus a few fields from table t.Accounts and t.History tab Transactions - portal to table t.Transactions and some global fields from local table t.AccountsUI plus some fields from table t.Transactions (not in portal) like the field k.Trasnactions that I put only onto this tab in the hope it would keep the focus on this tab tab Parties - portal to table t.Parties and some global fields from local table t.AccountsUI tab Regulars - empty The script I'm running is activated by a button on the tab Transactions. When it hits the Go to Row 1 step it jumps to the first row on the portal of tab Accounts. I tried by changing the script and added a Go to Field step pointing to a field in the t.Transactions table on the portal of the tab Transactions, but when it executed this script step it jumped to that field on the tab Overview as this also has a portal to the table t.Transactions. Looks like I'm caught by the short and curlies and will have to upgrade...
  9. Hi - I'm using FMP8 and have some trouble with my DB. I have a layout with multiple tabs - say tabs A, B, C, D. Each tab has a portal. The tab showing is C and it has a button to execute a script. As soon as the script hits the Go to Portal Row step FMP switches to a different tab. I tried creating a field, made it visible only on tab C, and then added a Go to Field step before the Go to Portal Row, but it still changes the tab. Why? And how can I make FMP stay on the same tab? Here's my script: Set Field [ t.AccountsUI::g.CurrentTab; "Transactions" ] Go to Layout [ original layout ] Go to Field [ t.AccountsUI::k.Transactions ] [ Select/perform ] Set Field [ t.AccountsUI::k.Transactions; "Transactions" ] Set Selection [ t.AccountsUI::k.Transactions ] Go to Portal Row [ 1 ] [ Select ]
  10. I am trying to set-up something similar, but I would like to perform dynamic sorts with multiple keys in various order. So far I have defined a checkbox set which list the available keys. I have associated this checkbox set with a global field g.SortList. As I click on the individual check boxes the desired key order is stored in g.SortList. So far so good. Now I would like to perform a sort using the stored list in g.SortList, but I can't find a way to perform either a sort based on the list or a number of successive sort based on each list item. However, I found that AppleScript may be able to do this: Is this really the only way?
  11. I am trying to upgrade multiple instances of the same DB with a new version of the DB (improved scripts, layouts, etc.). I added a script to each DB instance which allows me to export all relevant tables from the existing DBs. I can then start the new DB version (blank) and import the tables/data back. As I cannot dynamically assign file names to the exported tables and I don't want to have to change the export/import file references manually, I decided to export all tables to a folder with the static name 'export' and therefore I can reference the same path for the import. But in order to keep tables from different DB instances separate I created an AppleScript that creates a folder with the name of the DB 'export <DB name>' creates an alias called 'export' pointing to the DB specific export folder created in the previous step exports all tables using file reference 'file:export/<table name>' as output file But when I tested my FM script I keep getting errors ("... could not be created on this disk..."), because FM doesn't seem to be able to follow a file reference that includes an alias. Is there something I'm doing wrong or does FM indeed not handle aliases? Cheers, Michael.
  12. I solved the problem: property theFMPath : "file:/Mac hd/Users/X/Documents/foo/bar/baz/quux v1M 0.9.fp7"
  13. Thanks very much for help Fenton I have decided to use an AppleScript - but I have a few problems getting this to work in FM... How can I use a working AppleScript work in FM? Cheers, Michael
  14. I have created an AppleScript which works fine when I run from my AppleScript Editor. But when I copy it into FM and after I escaped all quotes I can't get it to run. It runs fine in FM as native script, but when I try to use it as Calculated AppleScript I get errors. Here is my script: property theFMPath : "file:/Mac hd/Users/X/Documents/foo/bar/baz/quux v1M 0.9.fp7" property theFMFile : "quux v1M 0.9.fp7" property theFolder : "export " & theFMFile property theAlias : "export" tell application "Finder" --Convert path from FM format (file:/foo/bar/baz/quux.fp7) to AS format (foo/bar/baz) log "theFMPath = " & theFMPath set savedTextItemDelimiters to AppleScript's text item delimiters try set AppleScript's text item delimiters to {"/"} set theCount to (number of text items in theFMPath) log "theCount = " & theCount set theTmpPath to text items 2 thru (theCount - 1) of theFMPath log "theTmpPath = " & theTmpPath set thePath to "" set theDelimiter to "" repeat with currentFile in theTmpPath log currentFile set thePath to thePath & theDelimiter & currentFile set theDelimiter to ":" end repeat log "thePath = " & thePath set AppleScript's text item delimiters to savedTextItemDelimiters on error set AppleScript's text item delimiters to savedTextItemDelimiters end try --Create DB specific export folder 'export-<DB name>' if (exists folder theFolder of folder thePath) then delete folder theFolder of folder thePath end if make new folder at folder thePath with properties {name:theFolder} --Create generic alias 'export' pointing to 'export-<DB name>' if (exists file theAlias of folder thePath) then delete file theAlias of folder thePath end if make alias file to (folder theFolder in folder thePath) at folder thePath with properties {name:theAlias} end tell What I'm trying to do is use FM functions Get(FilePath) and Get(FileName) to populate the properties theFMPath and the FMName. I have reduced my script to this snippet in the Calculated AppleScript part: " property theFMPath : "file:/Mac hd/Users/X/Documents/foo/bar/baz/quux v1M 0.9.fp7" property theFMFile : "quux v1M 0.9.fp7" " and FM keeps saying: If I use only one property, it works: I also tried to make the path conversion more elegant, but I always got errors when running it from my AppleScript Editor: BTW, I tried it with and without the combinations of leading "file:", "/", and "Mac hd". Any suggestions would be highly welcome. Cheers Michael " property theFMPath : "file:/Mac hd/Users/X/Documents/foo/bar/baz/quux v1M 0.9.fp7" " log "theFMPath = " & theFMPath set theMacPath to POSIX file theFMPath log "theMacPath = " & theMacPath
  15. Sticky indeed Anyway, the old balance files have been exported by FMP7, i.e. I can import real FM files. It's a single file and not related to any table. I do know what the exported file is called, but the caller will have them in different locations. As it is an accounting solution, all files for one accounting each year are kept in its own folder. The typical name for a folder is '<user> <year>'. This was done to allow multiple users sharing the same computer to maintain their own DB - under OS9 we had no real separation of user areas, which is why the user name ended up in the folder name. I said 'latest' as a user has potentially other exported files from earlier years, but I don't need to worry about them as I only need to import the latest one. Cheers, Michael.
  • Create New...

Important Information

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