文件生成器快照文件具有布局ID。但是,使用“转到布局编号”并不能像我预期的那样工作。
Set Variable [$json; Value:Get(ScriptParameter)]
Set Variable [$layout_id; Value:JSONGetElement ( $json ; "UIState.Layout.@id" )]
Go to Layout [$layout_id] // layout number by calculation
// ends up on a completely different layout than the one the snapshot file opens.
我发现布局ID和布局编号是两个不同的数字…这就是“转到布局编号”脚本步骤失败的原因。
用作上述脚本参数的JSON字符串是。
{
"UIState": {
"UniversalPathList": "fmnet:/10.1.1.63/Balanced.fmp12\nfmnet:/10.1.1.220/Balanced.fmp12\nfmnet:/169.254.254.47/Balanced.fmp12\nfilemac:/Macintosh HD/source/fmp16/Balanced.fmp12",
"Rows": {
"@rowCount": "1",
"@baseTableId": "131",
"#text": "21383239"
},
"Layout": {
"@id": "2"
},
"View": [
],
"SelectedRow": {
"@id": "21383239"
},
"StatusToolbar": {
"@visible": "True"
},
"Mode": {
"@value": "browseMode"
},
"SortList": {
"@Maintain": "True",
"@value": "False"
}
}
}
可以从命令行运行。例子
open 'fmp://filemaker.server/Balanced.fmp12?script=snapshot_link¶m={ "UIState": { "UniversalPathList": "fmnet:/10.1.1.63/Balanced.fmp12\nfmnet:/10.1.1.220/Balanced.fmp12\nfmnet:/169.254.254.47/Balanced.fmp12\nfilemac:/Macintosh HD/source/fmp16/Balanced.fmp12", "Rows": { "@rowCount": "1", "@baseTableId": "131", "#text": "21383239" }, "Layout": { "@id": "2" }, "View": [], "SelectedRow": { "@id": "21383239" }, "StatusToolbar": { "@visible": "True" }, "Mode": { "@value": "browseMode" }, "SortList": { "@Maintain": "True", "@value": "False" } } }'
在给定有效布局ID的情况下,查找要在文件生成器中显示的正确布局的好方法是什么?