Convert all external styles as inlines

Hi to all you action gurus out there
(I don’t count my self as anything but a dabbler in action writing)
As we all know Freeway is a fantastic tool for the non techie designer and I think everyone would agree that where it really is head and shoulders above any of the competition is in table construction… Even my Dreamweaver colleagues agree it’s a bloody good tool in created table based pages. So its unfortunate that in the construction of Emails that Freeway gets most of the way their but fails at the last hurdle.

What do I mean by this: Well ideally I as a designer I would design and build my Email in HTML 4.01 and then on publish I would ‘at a flick of a switch’ create the page with nothing but inline styles,
but unfortunately Freeway cant do this well not automatically.
I know It would be nice to do this in the publishing cycle rather than reply on an action to edit the code after it’s been created, but I am probably correct in thinking that the softpress gang have there hands full in just trying to get all the inline css out of the html and to make it full inline would probably be a bit of a backwood step.

So hence I came up with a rough action that did some of what I needed to do like: remove unwanted items within the HTML and allow centering on an outer table ad move the CSS styles to within the body
No wthis did a fair job but to make my emails more email app friendly, I have been using Textmate and a bundle to sniff though the published html and move all the external css references into inline ones.
Since making the original action I have been thinking that it would be nice if the last part of the hurdle (inline styles) could be handled by the action…

Recently I found an alternative to Textmates bundle found here:

and what’s interesting with this one over Textmates is that the developers have opened it up to allow other apps to use it from within their environment.

Now I have never tried to post a request from within an action but can any one see why this couldn’t happen within a freeway action in the manner that torchboxapps describes and if so has any one tried. got any examples etc.

Be good to hear other’s thoughts, suggestions on this.
all the best Max


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

Hi Max,
You can call CURL from an AppleScript that’s embedded in your action.
The CURL command will emulate a form post and should return the
converted source code back to your action.
Here’s an example that will take the source code for the current page,
submit it for conversion, and then replace the page source for this
modified version on page publish;
http://www.freewayactions.com/code/inline-styler.php

Things to watch out for;

  1. A lack of a live internet connection when the page is published
  2. The Inline Styler service being down, moved or updated
  3. The service returns something other than a converted page (errors
    for example)

Your action should ideally fail gracefully if the conditions above
stop the conversion of the page. If you are at all worried about
things like this then try creating your own inline styler as an
action. It shouldn’t take too much work to integrate this
functionality into an action (especially if the styles are all in the
document head).
Regards,
Tim.

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

cor blimey Tim thats was quick!!!
well it worked exactly as I hoped…
I didn’t even realise you could call out to an external connection. So I was only expecting some feedback but to get an actual working model was a massive bonus.

I agree with you on the “it should ideally be something that the action should handle internally”, plus all the other caveats you mentioned but this does at least (combined with my rough action bits) gets to something near a finished HTML result without the need to use an external text editor to finnish things off.

Thanks Tim for the complete example and all the best
ps happy chrimbo

Max


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

One of the things I wanted to mention but forgot to in my last e-mail
was that at the moment actions aren’t really aware of things like
calls to web services. If you want to provide your user with an
indicator that the action is off doing something online (calling a
service for example) then at the moment that will have to be done
manually in the actions interface. Ideally I’d like to see actions
handle this in a more integrated fashion so that the user gets to see
some progress (waiting) UI rather than just thinking the application
has just frozen.
Keep us updated on the action front and, thanks, a merry Christmas to
you too!
Regards,
Tim.

On 15 Dec 2009, at 09:29, max wrote:

cor blimey Tim thats was quick!!!
well it worked exactly as I hoped…
I didn’t even realise you could call out to an external connection.
So I was only expecting some feedback but to get an actual working
model was a massive bonus.

I agree with you on the “it should ideally be something that the
action should handle internally”, plus all the other caveats you
mentioned but this does at least (combined with my rough action
bits) gets to something near a finished HTML result without the need
to use an external text editor to finnish things off.

Thanks Tim for the complete example and all the best
ps happy chrimbo

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