x_actly Posted January 5, 2005 Posted January 5, 2005 Goal: click on a field (a field designated as a button) and copy its contents to the clipboard. Technique: for efficiency and simplicity, use a single script that is called by any designated field. Problem: How to pass the name of the "target" field that is clicked without hardcoding a script parameter for each and every field? The field is not actually entered so you cannot use get(ActiveFieldName), and neither the Copy nor Go To Field... scriptsteps allow you to calculate a target field anyway - the field must be hardcoded. Am I missing something obvious? Is there no way in Filemaker to just pass the name of the clicked object, such as HyperCard's "get the name of the target and put it into fieldName" followed by "go to field fieldName"?
transpower Posted January 5, 2005 Posted January 5, 2005 Make a calculated field set to Get (ActiveFieldName).
Søren Dyhr Posted January 5, 2005 Posted January 5, 2005 Just a comment... programming shouldn't include the clipboard - since the user might have something important hidden there!!! --sd
x_actly Posted January 5, 2005 Author Posted January 5, 2005 Errrr...not sure how I would use a calculated field. Since "Allow user to Enter Field" is OFF in browse (protecting the data), the field is not active, even if clicked on...which is why I want the field to be a button which then triggers the COPY script. Even if I can identify the field, the Go To Field... script step does not seem to allow calculated field names - only hardcoded names, which means a seperate script or script parameter for every field. There must be a more efficient way!
x_actly Posted January 5, 2005 Author Posted January 5, 2005 Programming shouldn't included the clipboard?? The WHOLE POINT in this case IS to copy the field contents to the clipboard so that the user can then paste the specific info into other apps/docs. Since the fields are not enterable in browse mode, there is no way to copy their contents if the user needs to...which kinda sux. And hardcoding a script or parameter for each field seems a bit...silly.
Søren Dyhr Posted January 6, 2005 Posted January 6, 2005 And hardcoding a script or parameter for each field seems a bit...silly. Why is it silly to make a parameter when defining the button ...the script would/could be shared anyway. I think I would use GetField ( Get ( ScriptParameter ) ) to set a global field which then are copied to the clipboard from a layout where copy access is only for this field. --sd
Søren Dyhr Posted January 6, 2005 Posted January 6, 2005 me field names can be long and descriptive! There is a solution to this as well - In the parameter calc stuff this: MiddleValues ( FieldNames ( Get ( FileName ) ; Get ( LayoutName ) ) ; 4 ; 1 ) ...which in this case plucks the 4th field! All it then takes is just to alter the numbers accordingly! Nor can the global be located on the layout because it will highlight when its entered programatically for the Copy script step. In the scriptsteps switch to this utility layout just for this purpose and switch back again when the deed is done! --sd
Recommended Posts
This topic is 7264 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 accountSign in
Already have an account? Sign in here.
Sign In Now