This topic needs a title

Hi every one :slight_smile:

It has been some time since I last wrote with my last problem, and in the intervening time I have been getting on quite well, but as always I have come up with something which I am unsure of on how to tackle.

So rather than flounder around, I thought I would see if any one could help. I am sure what I am trying to do looks really, really simple but it has got me stuck, so any help would be much appreciated.

This is what I want to achieve:
I have created an action with a URL element

   <action-url name="MyURL" />

and what I want to do is if I choose a url link in the action drop-down, the action will write some script.
but if I don’t choose anything in the url then it wont.
This is really my first forage into url links so please be patient.
I first I thought I would use if and else but then I thought surely there would be a way in that the script would only be added if the drop-down contained a value (an actual link) and ignored if it did not. Is this correct or do I have to use some other method

I am sorry if it sounds dumb or basic but I cant work it out. If there are any simple example anywhere then it would be very very helpful.

Again thank you in advance for any help

pem :slight_smile:


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sorry!! :frowning: I forgot to add a subject to this thread and I didn’t know how to add one after I clicked on send.
I suppose the thread should be: Adding a script based on a link having a value.

pems :slight_smile:


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Pems
You could do it this way (this is sort of part of something I am doing at the mo)

  function fwAfterEndBody() {
  var bodyTag = fwDocument.fwTags.fwFind("body");
  if (bodyTag)
   {
      if (fwParameters.MyURL.fwValue != "") bodyTag.fwAddRawln('add your script here');
   }
 }

this would only add your script if there was a link actually used in the URL link
I’ve not tested it completely though it should work.

all the best max


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thank you max this was what I was looking for

pems


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

My only comment here would be to spin this around so that the checking
of the control value is done before anything else. Currently the
action is doing work that may not get used if it finds the ‘MyURL’
control unset.
A minor thing but it will save time debugging code that shouldn’t be
running.
Regards,
Tim.

On 22 May 2009, at 04:28, max wrote:

Hi Pems
You could do it this way (this is sort of part of something I am
doing at the mo)

 function fwAfterEndBody() {
 var bodyTag = fwDocument.fwTags.fwFind("body");
 if (bodyTag)
  {
     if (fwParameters.MyURL.fwValue != "")  

bodyTag.fwAddRawln(‘add your script here’);
}
}

this would only add your script if there was a link actually used in
the URL link
I’ve not tested it completely though it should work.

FreewayActions.com - Freeware and shareware actions for Freeway
Express & Pro.

Protect your mailto links from being harvested by spambots with Anti
Spam.
Only available at FreewayActions.com

http://www.freewayactions.com


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options