Custom fuctions for script "Go to calendar List or Tabl

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 5
Joined: Mon Dec 11, 2006 7:06 am
PostPosted: Mon Dec 11, 2006 7:13 am
In the script "Go to calendar List or Table" the used custom function is not available in SeedCodecalendar.

Can anybody give me the custom function I should put into the script.

Greetings,

Edwin Roos
The Netherlands
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Mon Dec 11, 2006 7:57 am
Sure. The custom function "SeedCode_GetScriptParameter" is used throughout the calendar to make it easier to pass multiple parameters to scripts.

Its is called like this SeedCode_GetScriptParameter ( Name )

Here is the function and its explanation:

Code: Select all
/*
Where "Name" is the name in a Name/Value pair like: "Operation = Begin".
Separate Name/Value pairs with semicolons like: "Operation = Begin ; Status = Estimate".
Quotes are optional in the value: "Operation = Begin ; Response = \"OK\""
Fields can be entered like this: "Operation = Begin ; Status = " & job::status
If a requested value is not present, the result is blank.
*/

Let ( [
string = Substitute ( Get ( ScriptParameter ) ; [ "\"" ; "^^" ] ; [ " ;" ; ";" ] ; [ ";" ; "\" ;" ] ; [ "= " ; "=" ] ; ["=" ; " = \"" ] ; ["¶" ; "~~" ] ) & "\"" ;
eval = Evaluate ( "Let ( [" &  string  & "] ;" & Name & " )" ) ;
result = Substitute (  eval ; [ "^^" ; "\"" ] ; [ "~~" ; "¶" ]  )
] ;

If ( result ="?" ; "" ; result )

)


Hope that helps.
John Sindelar
SeedCode
Posts: 5
Joined: Mon Dec 11, 2006 7:06 am
PostPosted: Tue Dec 12, 2006 4:33 am
I´m not sure how to put the function in the script as shown below. Can you put it in there for me?:

Get ( Script Parameter ) &

"; Target = " &
If ( Get ( LayoutNaam ) = "Daily" ;
Case (
<Function missing><Function missing> ( "TabAppointments" ; "isFrontTabPanel" ) ; "Appointments" ;
<Function missing><Function missing> ( "TabToDoList" ; "isFrontTabPanel" ) ; "ToDos" ;
<Function missing><Function missing> ( "TabOtherItems" ; "isFrontTabPanel" ) ; "Others" ;
"Appointments"
) ;
"Appointments"
)
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Dec 12, 2006 6:29 am
Ah! Sorry about that.

What you're seeing is not a custom function. You're seeing a function from FileMaker 8.5 and, having opening the calendar in FileMaker 8, it is missing. This isn't something you need to worry about since that line of the script (line 11) is in an If() statement and only runs if you're using 8.5.

If you don't like the missing stuff, you can replace line 11 with another copy of line 13, but I'd leave it along in case you do move to 8.5

That section of the script looks to see which tab you're on and goes to the appropriate list view-- we can do that more elegantly in FileMaker 8.5 since we can explicitly ask which tab you're on.

Sorry for the confusion on my part!
John Sindelar
SeedCode
Posts: 5
Joined: Mon Dec 11, 2006 7:06 am
PostPosted: Tue Dec 12, 2006 6:44 am
Thank you for your comment. I overlooked that part of the script!

In the dutch version of Filemaker 8 the get function for the applicationversion gives the following string:

ProAdvanced 8.0v3

As you see the "," is a "." in 8.0, Therefor the script does not dump over the IF statement.

A Hourglass is the result when clicking on the icon for listview for example and the application hangs untill you press repeatingly on ESC to exit the script.

Thanx for your info!
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Dec 12, 2006 6:54 am
Hmmm.

It returns the same thing in the English version. That is why we wrap the app version in RightWords() and GetAsNumber() so that we can do greater-than tests with it...

GetAsNumber ( RightWords ( Get ( ApplicationVersion ) ; 1 ) )

Would you be able to let me know what the calc above returns on your system?

Best,

John
John Sindelar
SeedCode
Posts: 5
Joined: Mon Dec 11, 2006 7:06 am
PostPosted: Wed Dec 13, 2006 2:48 am
John,

For your information:

Get (Applicationversion) gives ProAdvanced 8.0v3

GetAsNumber ( RightWords ( Get ( ApplicationVersion ) ; 1 ) ) gives 803

So far.

Greetings,

Ed
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Dec 13, 2006 6:39 am
eroos wrote:GetAsNumber ( RightWords ( Get ( ApplicationVersion ) ; 1 ) ) gives 803


Wow. In the english versions it returns 8.03

So I guess you should change the If() test in your version to use ">850".

I'll change our calcs so they are more generic in light of this issue. Thanks so much for pointing this out; I'd have never thought there was a difference.

Thanks again!

John
John Sindelar
SeedCode
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Dec 13, 2006 7:54 am
Hi. Can I trouble you for one more item... Would you be able to let me know what this returns on your Dutch system:

RightWords ( Get ( ApplicationVersion ) ; 1 )

Thanks!
John Sindelar
SeedCode
Posts: 5
Joined: Mon Dec 11, 2006 7:06 am
PostPosted: Wed Dec 13, 2006 12:46 pm
John,

No problem!

You're application saved me loads of time. So this little effort is no prob. at all.

RightWords ( Get ( ApplicationVersion ) ; 1 ) gives 8.0v3

Keep on the good work!

Ed

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 2 guests

cron
(855) SEEDCODE
[email protected]
Follow us: