How can I get the path to the resources folder?

I need to get the path to the Resources folder that my Action will use
before I put a file there. The reason for this is that I need to do
string substitution within that file to let it know where to look for
related files.

I know that calling toString on a fwFile will give me its published
path, but I need to do this before I publish the file, and I’m not
sure if publishing it, getting the path, and then publishing it again
after editing the contents in memory will result in the updated file
being uploaded.

Is there a shorthand I can use for this value?

Thanks,

Walter


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

fwClearGif should do it for you Walter.
Productivity resumed! :slight_smile:
Regards,
Tim.

Quoting Walter Lee Davis email@hidden:

I need to get the path to the Resources folder that my Action will use
before I put a file there. The reason for this is that I need to do
string substitution within that file to let it know where to look for
related files.

I know that calling toString on a fwFile will give me its published
path, but I need to do this before I publish the file, and I’m not
sure if publishing it, getting the path, and then publishing it again
after editing the contents in memory will result in the updated file
being uploaded.

Is there a shorthand I can use for this value?

Thanks,

Walter


Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


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

But there’s only ever one _clear.gif in a site, and if the Action is
applied to a page several folders deep, that won’t necessarily be the
one where the files end up.

I wish there was a variable exposed for this, it’s quite maddening. I
have a work-around working, but it’s not entirely clear to me if it
will work.

Walter

On Mar 26, 2009, at 3:37 PM, email@hidden wrote:

fwClearGif should do it for you Walter.
Productivity resumed! :slight_smile:
Regards,
Tim.


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

OK fair point. What about using a toString() to get the path from a file control
early on in the publish process (after start html?) and use this as a guide for
later exploits in the publish process?
Regards,
Tim.

Quoting Walter Lee Davis email@hidden:

But there’s only ever one _clear.gif in a site, and if the Action is
applied to a page several folders deep, that won’t necessarily be the
one where the files end up.

Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


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

That’s what I’m doing here, just was hoping there was some poorly-
documented API call that exposed what Freeway must actually know at
some point, since it’s handling these files and all.

Walter

On Mar 26, 2009, at 3:58 PM, email@hidden wrote:

OK fair point. What about using a toString() to get the path from a
file control
early on in the publish process (after start html?) and use this as
a guide for
later exploits in the publish process?
Regards,
Tim.

Quoting Walter Lee Davis email@hidden:

But there’s only ever one _clear.gif in a site, and if the Action is
applied to a page several folders deep, that won’t necessarily be the
one where the files end up.

Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


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


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

HI,

Not sure if this will help, but my CSS Rollover Action seeks out published files to build the sprite. This is a tricky and dangerous thing to do as we have all found, there is no clean way to get it.

You can base your path on fwFolder() and fwHttpPath(), but monkeying about is needed to remove any pesky relative …/ in the path Freeway returns.

For what it’s worth, I cobbled this function together:

function makeImagePath(folderPath , imagePath){
        myPos = folderPath.lastIndexOf("/");
        var the_length=folderPath.length;
        var last_char=folderPath.charAt(the_length-1);
        if (last_char == "/")
                folderPath = folderPath.substring(0,the_length-1);
	
        var loop = true;
        while(loop == true)
        {
                loop=false;
                if (imagePath.indexOf("../")>=0)
                {
                        loop = true;
                        myPos = imagePath.indexOf("../");
                        imagePath = imagePath.substring(myPos+3,imagePath.length);
                        myPos = folderPath.lastIndexOf("/");
                        folderPath = folderPath.substring(0,myPos);
                }
        }

        return(folderPath + "/" + imagePath);
}

Call it with:

imageSrc = image.src.toString().slice(1,-1);
myImagePath = makeImagePath(fwFolder.fwHttpPath(null,true).toString() , imageSrc);

Where imageSrc is the source of image (in this case, one).

Note that this information is only available at publish time.

Looks like the code block code is a bit mischievous too.


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

Code is “fenced off” with a row of tildes on either side of it, alone
on a line (must be matching number on each side):

This is some code

Walter

On Apr 24, 2009, at 4:22 AM, Paul wrote:

Looks like the code block code is a bit mischievous too.


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

I’ve just pimped the syntax highlighter to let you use your preferred syntax. Watch the live preview to see it working:

This is a line of code
$out = preg_replace('/([CODE])/i',"~~~~n",$out);
$out = preg_replace('/([/CODE])/i',"~~~~n",$out);

Walter


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