Hi there. I've noticed that trying to open a complex URL using the Open URL script in SeedCode complete is not working once it hits the "SeedCode_GetScriptParameter" custom function. I think it's because there's an equal sign in the URL:
Here's a sample URL I'm trying to open... but nothing happens. I believe the the custom function leaves the "$Address" variable empty:
http://www.facebook.com/profile.php?id=1170694181
What's the best way to get around this? Thanks. -Charlie
Here's the "SeedCode_GetScriptParameter" custom function:
Let ( [
string = Substitute ( Get ( ScriptParameter ) ; [ "\"" ; "^^" ] ; [ " ;" ; ";" ] ; [ ";" ; "\" ;" ] ; [ "= " ; "=" ] ; ["=" ; " = \"" ] ; ["¶" ; "~~" ] ) & "\"" ;
eval = Evaluate ( "Let ( [" & string & "] ;" & Name & " )" ) ;
result = Substitute ( eval ; [ "^^" ; "\"" ] ; [ "~~" ; "¶" ] )
] ;
If ( result ="?" ; "" ; result )
)
Error opening complex URLs in Contacts using Open URL script
8 posts
• Page 1 of 1
Posts: 47
Joined: Sun Sep 02, 2007 9:57 am |
|
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
I think the following will teach it to accept an equal sign in the param itself:
Let ( [ string = Substitute ( Get ( ScriptParameter ) ; [ "=" ; "!!!!" ] ; [ "\"" ; "^^" ] ; [ " ;" ; ";" ] ; [ ";" ; "\" ;" ] ; [ "= " ; "=" ] ; ["=" ; " = \"" ] ; ["¶" ; "~~" ] ) & "\"" ; eval = Evaluate ( "Let ( [" & string & "] ;" & Name & " )" ) ; result = Substitute ( eval ; [ "!!!!" ; "=" ] ; [ "^^" ; "\"" ] ; [ "~~" ; "¶" ] ) ] ; If ( result ="?" ; "" ; result ) ) John Sindelar
SeedCode |
Posts: 47
Joined: Sun Sep 02, 2007 9:57 am |
That appears to break some other interface navigational elements... the List/Detail/Table buttons didn't work anymore once I changed the custom function.
|
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
Ah, we probably use !!!! as a delimiter in those. Replace !!!! in the custom function with _!_!_!_!
(did the url work?) John Sindelar
SeedCode |
Posts: 47
Joined: Sun Sep 02, 2007 9:57 am |
Well, I may be doing it wrong, but when I changed it it didn't work either.
The detail/list/table buttons did not work and the url didn't launch. |
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
ACK! I'm so sorry Charlie; I was not thinking clearly when I sent this. There is no way we can map the = sign in the parameter. BUT we can translate it at the end. So if you change the "=" in your url to _!_!_!_! the following function will turn that into a "=" when it's all done:
Let ( [ string = Substitute ( Get ( ScriptParameter ) ; [ "\"" ; "^^" ] ; [ " ;" ; ";" ] ; [ ";" ; "\" ;" ] ; [ "= " ; "=" ] ; ["=" ; " = \"" ] ; ["¶" ; "~~" ] ) & "\"" ; eval = Evaluate ( "Let ( [" & string & "] ;" & Name & " )" ) ; result = Substitute ( eval ; [ "_!_!_!_!" ; "=" ] ; [ "^^" ; "\"" ] ; [ "~~" ; "¶" ] ) ] ; If ( result ="?" ; "" ; result ) ) John Sindelar
SeedCode |
Posts: 47
Joined: Sun Sep 02, 2007 9:57 am |
So, just so I have this straight here...
The first step in the script (currently) is Set Variable [$Address; Value:SeedCode_GetScriptParameter ("Address")] You're instructing me to: Capture that "Address" beforehand in another variable, substitute the "=" sign in that string with _!_!_!_!, then re-insert the "=" sign later, and reset the "$Address" variable to the original string before I send it to the Open URL step? I think I understand that. ********************* While I'm here, I see in the ERD you have MailingMembers linked to Appointments... but I don't see any interface layouts to link the two together in the UI so that the merge tokens you've set up will grab data from the Appointment itself. Is there a mini-window (or something) somewhere that I've missed that links Appointments to Mailings? Thanks again for your tremendous support, you're amazing. -Charlie |
Posts: 47
Joined: Sun Sep 02, 2007 9:57 am |
I worked out a different way. I trapped for the value string before the SeedCode GetScriptParameter custom function is called. If it's a URL I just have it OpenURL without calling the custom function.
|
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 3 guests