Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6666 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

The following short script returns only "0" where I expect the desired text to appear (is that the "no error" error message?). All the other lines seem to function correctly. I wrote the script so that I could use it from any Layout in my database. The database collects all the information regarding my photographs. The script is meant to produce I.D. cards from the data to use at art fairs. Thanks for your help.

My Script:

Enter Browse Mode []

Go to Layout ["Display Cards" (Photo Catalog)]

Perform Find [Restore]

Set Field [Photo Catalog::Display Size = "8x10 on 14x18 archival mat"]

Set Field [Photo Catalog::Price = "150"]

Sort Records [Restore; No dialog]

Commit Records/Requests [No dialog]

Enter Preview Mode [Pause]

Go to Layout ["Display Cards" (Photo Catalog)]

Posted

"The following short script returns only "0" where I expect the desired text to appear (is that the "no error" error message?)"

The script you posted seems to have nothing to do with your question. No text is returned anywhere and no error testing is being performed.

  • Newbies
Posted

Well, I want the script to place the texts in " " into the field specified. Obviously I'm missing something. I'm doing this by trial and error (hunt and peck) with the 30 day trial of FM8.5. I have no manual other than the Help file that came with it. I've used all the variations I can see in the script maker (every specify button) and the best result I get is "0". What am I doing wrong? How can I fix this?

Posted

I not sure what you are wanting to do either, but some of your script steps seem to fall into the wrong order.

Enter Browse Mode []

Go to Layout ["Display Cards" (Photo Catalog)]

Perform Find [Restore] this restores a find that you have setup and performs it

Set Field [Photo Catalog::Display Size = "8x10 on 14x18 archival mat"] This step does nothing in Browse Mode, which you would be in.

Set Field [Photo Catalog::Price = "150"] This step does nothing in Browse Mode, which you would be in.

Sort Records [Restore; No dialog]

Commit Records/Requests [No dialog]

Enter Preview Mode [Pause] The order of these last two items are reverse.

Go to Layout ["Display Cards" (Photo Catalog)] or this step is unnecessary as you would already be on this layout

Maybe if you tell us the Layouts involved, and what you are trying to accomplish and attach a sample of your file we can help figure this out for you.

Lee

  • Newbies
Posted (edited)

I’m sorry this is long but I don’t know how else to give you more information so that you might give me advice. Please bear with me.

I've changed the script slightly based on what the two of you have already said (thanks) and I get partially successful results (still). The new script is at the end. I would attach the database but its 3.2 MB, more than I can send, and I don’t know how I would send you only part of it. I hope this helps you help me.

Background:

The database is a collection of information regarding my portfolio of original photographs. It contains everything from negative (i.e., image) numbers to who purchased what size print when and how much they paid for it. I am entering and accessing this information through a variety of tables and forms/layouts depending upon the need. The common/linking field throughout the tables and forms is "negative number" representing the unique number I assign each of my negatives.

The Plan:

I want to use the current form (“Display Cards”) to pull together information from five fields to print identification cards that will display with my photographs at art fairs. The five fields are: title; price; displayed size; available sizes; negative number.

The three fields title, available sizes, and negative number are directly supplied as set up with the field/control function in the existing table. Title and Negative Number are all unique. Available Sizes is pull-down in the originating form. The other two fields, displayed size and price, are empty text fields into which I want to insert specific text strings when the script is run.

Script Narrative:

The script (five identical scripts but each with the variable search below) is written to create sheets/pages of six cards to print from any layout in the table/database. It first enters the Browse Mode and then goes to the Layout "Display Cards". A find is performed to determine first which images I want to print display cards for and then which images I want a card printed for a specific print size. Both of these are handled with five different Yes/No buttons on the primary form (Print a card?, for size1, for size2, for size3, for size4). The first button is the first search and one of other buttons is the other search.

Now using the Insert Text script function, the script inserts at text string into the "Display Size" field. A second insert text function places the appropriate price into the "Price" field.

The resulting records are then sorted by Negative number. Enter Preview Mode presents the resulting sheets/pages to print. Leaving this takes me back to the Browse Mode in the original layout.

That's what's supposed to happen. But this is what happens.

The Result:

Each script successfully goes to Browse in the Display Cards form. Each pulls out all the records it’s supposed to. All displayed records show the correct negative numbers. Only two records have the text strings inserted, one correctly (not necessarily the same photograph in each search), one with the text string sets for size4 (always the same photograph). But neither of these shows either the Title or the Available size. All the others show the correct Title but only one record (the same record in each search) ever displays a value (the correct value) for the field Available Sizes. Also, the titles all have one or more hard carriage returns in them and are displayed correctly in the originating form but not necessarily here. It’s almost like the form is pulling up previous edits but not the current edit. This all holds true even after restarting FM8.5.

The Script:

Enter Browse Mode []

Go to Layout [“Display Cards” (Photo Catalog)]

Perform Find [Restore]

Insert Text [select; Photo Catalog::Display Size; “8x10 on 14x18 archival mat”] (varies with script)

Insert Text [select; Photo Catalog::Price; “$150.00”] (varies with script)

Sort Records [Restore; No dialog]

Enter Preview Mode [Pause]

Enter Browse Mode [] (is this redundant?)

Go to Layout [original layout] (I want to go back to the layout in which I activated the script, but I always end up in the “Display Cards” form even when I specify another layout instead of “original layout”.)

I need to amend the results I listed above. Nowhere is the field "Available Sizes" rendered correctly. The one record that shows data in this field when it appears shows instead the text string that is supposed to be inserted into the field "Displayed Size" and then it only shows one text string regardless the script run, not the one specified in the particular script.

One record throughout the scipts shows the same Price and Dsiplayed Size in all four scripts without change. It is supposed to show up in all four scripts but with the Price and DS specified in the particular script. Likewise a second record appears in the scripts it is supposed to (three), again with one set of text inserted throughout, but without showing its Title.

Only in case of one record do the Inserted Text strings show up accurately in the appropriate script results, but without its Title.

In one other case where the above record does not show up (and isn't supposed to) another record shows up apropriately with correct Title, Price, and Displayed Size but, like the rest, does not show Available Sizes.

Except for the Insert Text variables, all the data is present and accounted for everywhere else in all other forms and tables where it is expect as it is expected.

Help? Please?

Edited by Guest
Posted

Well for one thing I would go back to set field. Your use of the "=" sign was wrong, you want to do it like the insert text script step you showed.

But you haven't done anything to deal with the found set of records so it is no surprise that only one record gets set. You either need to use a loop sequence or the "Replace Field Contents" script step so that all records in the found set are processed.

A loop sequence is

Go to first record

Loop

set field etc

go to next record, exit after last

End loop

  • Newbies
Posted

This was helpful, Bruce. Thanks. I never would have guessed that not only do you have to tell the script what you want it to do, but also that it should do it.

I'm still using the "Insert Text" script but have added the "Replace Field Contents" script after each one. But this only works properly with the do not prompt option UNselected. I would prefer not to be prompted, but that doesn't seem to be a viable option.

I cannot use the "Set Field" script without the calculation "=". FMP8.5v1 (30 day trial) does not seem to give a way to write in the text variable otherwise.

Any answer to the above minor issues?

Anyway, I now have four separate scripts that return the expected text strings in the two fields Display Size and Price. Everything is now working, as it should.

I got the other missing or misplaced fields to work by linking them to my original data via the actual table that holds it instead of the fields that display it elsewhere in the current table. It’s probably just too far to travel otherwise. The Available Sizes was actually linked to what may have been an unused field.

Thanks for your help. This is a bit like flying your first solo without instruction or manual while wearing a blindfold.

Peace!

This topic is 6666 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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