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.
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.
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.
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.
Regards,
Tim.
On 18 Jan 2011, at 12:29, waltd wrote:
Tim, if you could post that Action code, I’d appreciate it.
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.
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.
Regards,
Tim.
On 18 Jan 2011, at 12:29, waltd wrote:
Tim, if you could post that Action code, I’d appreciate it.