Newbies MattO Posted December 23, 2014 Newbies Posted December 23, 2014 I have a music artist contacts database with fields for social media URLs. On the side of the layout I have image icons (Twitter, Facebook, etc..) that are buttons with corresponding scripts to "Open URL" typed in the fields. My desire is, if the URL field is empty, the button script can manage a dialog that reads (ex.) "Instagram URL does not exist" and then the user clicks "Ok" then the script ends. Likewise, if the field contains a valid URL then the script executes as normal, which is the basic "Open URL" function. Thanks for your help!!!
Miss A! Posted December 23, 2014 Posted December 23, 2014 Hi MattO, I am Novice and started with FM about 4 months ago, i will be very happy(if not excited) if my following script can help you. Provided that each button have an individual script to work its function/purpose(e.g specific script for Facebook button, Instagram etc), try something close to the following: If [ IsEmpty ( Table::Field _With_Url) ] Show Custom Dialog [ Title: "Sorry!"; Message: "Instagram URL does not exist"; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ] ElseOpen URL [ Table::Field_With_Url ] [ No dialog ]End If 1
comment Posted December 23, 2014 Posted December 23, 2014 On the side of the layout I have image icons (Twitter, Facebook, etc..) that are buttons with corresponding scripts to "Open URL" typed in the fields. IMHO, you need only one script, with each button passing a different URL as the script parameter. However, I wonder if it wouldn't make for a better user experience to have the buttons greyed out when the corresponding URL field is empty, and just beep when a greyed out button is clicked. 1
Newbies MattO Posted December 24, 2014 Author Newbies Posted December 24, 2014 Hi MattO, I am Novice and started with FM about 4 months ago, i will be very happy(if not excited) if my following script can help you. Provided that each button have an individual script to work its function/purpose(e.g specific script for Facebook button, Instagram etc), try something close to the following: If [ IsEmpty ( Table::Field _With_Url) ] Show Custom Dialog [ Title: "Sorry!"; Message: "Instagram URL does not exist"; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ] Else Open URL [ Table::Field_With_Url ] [ No dialog ] End If My dear-You NAILED it! Great job! Thanks so much...Scripting terrifies me for some reason. haha! Happy Holidays, Miss A! IMHO, you need only one script, with each button passing a different URL as the script parameter. However, I wonder if it wouldn't make for a better user experience to have the buttons greyed out when the corresponding URL field is empty, and just beep when a greyed out button is clicked. Hey thanks. Sounds very eloquent but in my case, unnecessary-thanks so much for the time to reply, my friend!
Recommended Posts
This topic is 3890 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