Jump to content

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

Recommended Posts

  • Newbies
Posted

I want to move the contents (grafx) of 1 container fields to another container field with a calculation.

No luck using a Case function.

Posted

You cannot move data with a calculation.  You'll need a script for that to use the Set Field script step.

Can you expand on what exactly you are trying to do and how you tried so far?

  • Newbies
Posted (edited)

Thanks for the reply.

What I want to do is to move an image from one container field to another. 

I may try using a script, but I'm beginning to doubt that automating this task would be aa fast as moving the data manually. 

What would be interesting to see if I could do this operation by voice with Siri or some other program.

Edited by trimtab
Posted

We would need to know a lot more about what you are trying to do and for how many records at once to know whether it would be faster to do manually.  It certainly would be less tedious to do it in a scripted fashion.

Don't shy away from using scripting, if you haven't used it much it will elevate your  solution to the next level.  And we're here to help you get there.

  • Newbies
Posted (edited)

Thanks for your help.

I believe I have the problem solved using scripts.

What I'm building is a customizable database for the study of chess.

There are 64 Container Fields for the chess squares.

The chessmen are jpeg images that are in the container fields.

Filemaker does not seem to tolerate transparent images that allow the color of the container field  to bleed through, so for each chessman, there are four (4) possibilities with respect to the color of the chessman and the chess square:

white on white, black on white, white on black and black on black.

If I could solve the transparency problem, I would only have 126 chessmen instead of 256. These images are transparent in Photoshop, but  is lost in after pasting the image into a Container Field, so when a black pawn on a dark square should look like this,

image.png.674e2db75a6e00089dc710a438b71243.png

 

it  looks like this:

image.png.cd2d3aab528c167ccf9997cd7b5b377c.png

 

There is no chess engine for playing chess--it is for studying the game.

For the opening study I typically only need to go 1/2 dozen or so moves deep to arrive at the characteristic position, so I accomplish that with a script that copies and pastes the image file for the chessman separating the moves with the resume/pause script command--not an elegant solution but it is functional.

When I run the script, the first chessman "moves",  and within the script successive chessmen are moved with the <Enter> key in the number pad of the keyboard, so I can advance forward.

Going backwards and forwards within the same script would be nice--but I have a workaround.

I had a similar problem with a project many years ago when I was animating the "drawing" of Chinese characters, which I did with Flash,

and then ran that "movie" inside a Container field in FM.

I know there are ready-made, off-the-rack solutions, but I'm looking for something tailor-made to my needs, and then FM is fun.

It's all a balance between building a study tool and doing the study itself with all the time contraints.

I'm happy with this project--but it'salways a pleasure to run a project by expert users of FM. 

Thanks again!

 

 

 

 

 

image.png

Edited by trimtab
Posted
  On 1/17/2020 at 3:49 PM, trimtab said:

The chessmen are jpeg images that are in the container fields.

Filemaker does not seem to tolerate transparent images that allow the color of the container field  to bleed through,

Expand  

Filemaker does respect the transparency of an image in a container field. However, the JPEG format does not allow for transparency. Try using the PNG or the GIF format instead. 

 

  On 1/17/2020 at 3:49 PM, trimtab said:

There are 64 Container Fields for the chess squares.

Expand  

I would use a single field with 64 repetitions. And I would use a Text field, with Unicode characters in the range of Char ( 9812) to Char ( 9823 ) representing the pieces: 
♚♛♜♝♞♟
♔♕♖♗♘♙

 

  On 1/17/2020 at 3:49 PM, trimtab said:

a script that copies and pastes the image file for the chessman separating the moves with the resume/pause script command--not an elegant solution but it is functional.

Expand  

If you want to show a succession of moves, you should have a related table of moves. Then a script that executes the moves one by one, with a pause in-between them. To move a piece, make your script set the target field to the source field, then set the source field to empty. Also make sure you have a way to restore the initial state.

--
P.S. Please update your profile to reflect your version and OS, so that we know what you can use.

 

  • Newbies
Posted

Thank you. I do like your suggestions.  The unicode fonts are attractive and would scale nicely and align better.  Also, the transparency problems If I do as you suggest, may no longer be an issue.  I've heard some negative feedback about using repetitions.  I forget the details--possibly with respect to performing searches.

One very useful feature would be searching databases of chess games.  I just heard of one collection of 15.9 million games, and to be able to search for sequences of moves could be interesting though I'm not sure how quickly such a search would be.

Not sure how to deal with black and white alternating squares and repeating fields because I thought all repetitons must be the same color.

I use FM mostly with Windows.  It is the Advanced version which the profile does not appear to have.  Wondering if the Windows version of FM is as robust as the Mac version, and also if FM runs with Linux.

The processor on the PC is an i9-7900X running at 3.31 GHz & I've got 32 GB of RAM.

Posted
  On 1/17/2020 at 10:46 PM, trimtab said:

I've heard some negative feedback about using repetitions.

Expand  

Depending on what exactly you want your solution to do, you may not want to use repeating fields to store data. In the current example, the field is used mainly for display and, if necessary, the actual data could be stored elsewhere (figuring how exactly would be an interesting challenge). 

 

  On 1/17/2020 at 10:46 PM, trimtab said:

I thought all repetitons must be the same color.

Expand  

You can use conditional formatting to set the fill color to black (or rather a darker color, if you want the black pieces to remain visible) when:

Let ( [
i = Get( CalculationRepetitionNumber ) - 1 ;
row = Div ( i ; 8 ) ;
col = Mod ( i ; 8 )
] ;
Mod ( row + col ; 2 )
)

 

  On 1/17/2020 at 10:46 PM, trimtab said:

It is the Advanced version which the profile does not appear to have.

Expand  

There is only one version 18. It becomes Advanced by setting an option in Preferences.

 

  On 1/17/2020 at 10:46 PM, trimtab said:

if FM runs with Linux.

Expand  

The FMP client runs only under Windows and macOS.  

This topic is 1866 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.