[Pro] adding script from an action in front of a tag

Hi action writers
Does anyone have a very… very… simple example of how to add something to the begining of a div
“I think” I know I have to add the script and then use fwMove but I just cant find an example which I can understand.

What I wish to do is add some code in front of the div tag on which the action is applied to. I have had a look at the crowbar action, but I just cant work out what is the minimum I need to make this happen and what is not nessassery.

Sorry for what is probably a very basic question :frowning:
Thanks you in advance
pems


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

Hi Pems,
Like this?
http://freewayactions.com/code/?f=Prefix-div-test.fwaction

Here’s the basic workflow;

  1. Find the div the action item is attached to (line 6)
  2. Check the search returned something (line 7)
  3. Create a dummy item that prefixes the div using fwAddEnclosing set to false so it only creates the opening tag (line 8)
  4. Use this wrapper to append your prefix code. In this case a simple comment (line 9)

Depending on what you want to add you may be better adding the code in at line 8 and doing away with a wrapper item.
I hope this helps.
Regards,
Tim.

On 7 Aug 2011, at 10:01, pems wrote:

What I wish to do is add some code in front of the div tag on which the action is applied to. I have had a look at the crowbar action, but I just cant work out what is the minimum I need to make this happen and what is not nessassery.

FreewayActions.com - Freeware and commercial 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

Thank you tim for the example that makes more sense.
I am assuming the pre part on line 9 is supposed to be prewrapper.
thank you again
Pems


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

Hi Pems,
Yes. Apologies for that. I changed the variable after I wrote the initial Action to make it easier to follow.
Regards,
Tim.

On 8 Aug 2011, at 06:51, pems wrote:

I am assuming the pre part on line 9 is supposed to be prewrapper.

FreewayActions.com - Freeware and commercial 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