Is it possible to rename an action-file?

I’d like to attach a file to the page, but change the filename in the process. Is there any support for this in the API? The documentation is markedly thin in this area.

I see that there’s a fwContentFile property, but it seems to be a getter, not a setter. Is there any way to use this property?

Or do I need to create a new fwFile, read the content of the action-file into it, and then write that out under my own control? I can imagine that could be costly from a memory and publishing time standpoint, as I’m planning to do this procedure to QuickTime movies.

Thanks in advance,

Walter


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

Hi Walter,

I’ve had a brief look into this and I think the only way to do it would be to rewrite the file.

Sorry,
Joe

On 17 Jan 2011, at 15:28, waltd wrote:

I’d like to attach a file to the page, but change the filename in the process. Is there any support for this in the API? The documentation is markedly thin in this area.

I see that there’s a fwContentFile property, but it seems to be a getter, not a setter. Is there any way to use this property?

Or do I need to create a new fwFile, read the content of the action-file into it, and then write that out under my own control? I can imagine that could be costly from a memory and publishing time standpoint, as I’m planning to do this procedure to QuickTime movies.

Thanks in advance,

Walter


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 Walter,
I’ve been thinking about this and although I don’t think you can change the file reference internally to the action i think you may be able to jump in early, change the original file name in the Finder, and have Freeway still reference the updated file on output. I created an action a while back that renamed the resources directory using a simple AppleScript and Freeway was quite happy to use this to write the src paths for any images (or other resources) on the site.
If you need to take a look at that action let me know and I’ll hunt it down.
Regards,
Tim.

On 17 Jan 2011, at 15:28, waltd wrote:

I’d like to attach a file to the page, but change the filename in the process. Is there any support for this in the API? The documentation is markedly thin in this area.

I see that there’s a fwContentFile property, but it seems to be a getter, not a setter. Is there any way to use this property?

Or do I need to create a new fwFile, read the content of the action-file into it, and then write that out under my own control? I can imagine that could be costly from a memory and publishing time standpoint, as I’m planning to do this procedure to QuickTime movies.


Tim Plumb
Creative Director
Softpress Systems

Follow us on Twitter: http://www.softpress.com/tny/064
Join us on Facebook: Redirecting...
Looking for a webhost? We love these guys: Softpress » Web Hosting Partners


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

Thanks Joe, that’s what I figured. Tim, if you could post that Action code, I’d appreciate it.

Walter


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

Hi Walter,
Looking at the code i’m not sure if this will help too much but here it is;
http://www.freewayactions.com/code/?f=Rename-Resources.fwaction

Maybe try the following;

  • use fwParameterChanged to detect when the user selects the file in the control
  • if it is the correct control and the file type is correct then get the file path
  • fire off an AppleScript (or terminal command) and rename the selected file
  • return true from the function and ‘hopefully’ FW will see the selected file with the updated file name

If this doesn’t work you could also try and duplicate the original file, rename it, and then programatically select this with the action using fwSpecify. Maybe. :slight_smile:
Regards,
Tim.

On 18 Jan 2011, at 12:29, waltd wrote:

Tim, if you could post that Action code, I’d appreciate it.


Tim Plumb
Creative Director
Softpress Systems

Follow us on Twitter: http://www.softpress.com/tny/064
Join us on Facebook: Redirecting...
Looking for a webhost? We love these guys: Softpress » Web Hosting Partners


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

Ah, if only there was an AfterPublish event in the chain, and you
could mark an Action as RunLast! I would just shell out, run sed on
the HTML and mv on the files.

Walter

On Jan 18, 2011, at 7:49 AM, Tim Plumb wrote:

Hi Walter,
Looking at the code i’m not sure if this will help too much but here
it is;
http://www.freewayactions.com/code/?f=Rename-Resources.fwaction

Maybe try the following;

  • use fwParameterChanged to detect when the user selects the file in
    the control
  • if it is the correct control and the file type is correct then get
    the file path
  • fire off an AppleScript (or terminal command) and rename the
    selected file
  • return true from the function and ‘hopefully’ FW will see the
    selected file with the updated file name

If this doesn’t work you could also try and duplicate the original
file, rename it, and then programatically select this with the
action using fwSpecify. Maybe. :slight_smile:
Regards,
Tim.

On 18 Jan 2011, at 12:29, waltd wrote:

Tim, if you could post that Action code, I’d appreciate it.


Tim Plumb
Creative Director
Softpress Systems
http://www.softpress.com

Follow us on Twitter: http://www.softpress.com/tny/064
Join us on Facebook: Redirecting...
Looking for a webhost? We love these guys: Softpress » Web Hosting Partners


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