Make a script function as a single action rather than many

Basically I have a loop that changes all the paragraph and character styles in a document for a particular language.
As such however, every time someone runs it, if you need to undo you have to hold down ctrl+z for a while. I'd rather if it ran a bit cleaner in this regard.
Here is the script, please let me know what I need to wrap it in in order to do this. Also, I'm running cs4, however I'd like it to be scalable for cs3 and cs5 as well, as currently it already does. All the best
/c
function arabic()
    var myStyles = app.activeDocument.allParagraphStyles;
    var myChStyles = app.activeDocument.allCharacterStyles;
//Paragraph Styles       
        for (oneStyle=1;oneStyle<myStyles.length;oneStyle++)
            myStyles[oneStyle].appliedLanguage= "Arabic";
            myStyles[oneStyle].ligatures= true;
            myStyles[oneStyle].hyphenation= true;
            myStyles[oneStyle].kerningMethod= "Metrics";
            myStyles[oneStyle].justification= 1919578996;
            myStyles[oneStyle].paragraphDirection= 1379028068;
            myStyles[oneStyle].paragraphJustification= 1886023265;
            myStyles[oneStyle].digitsType= 1684629609;
            myStyles[oneStyle].characterDirection= 1379028068;
            myStyles[oneStyle].composer= "Adobe World-Ready Paragraph Composer";
   //Pointsize, basic model
            var myPoint = myStyles[oneStyle].pointSize;
            myStyles[oneStyle].pointSize= myPoint + 3;
   //Leading, basic model
            var myLead = myStyles[oneStyle].leading;
            if (myStyles[oneStyle].leading == 1635019116){
                myStyles[oneStyle].leading = 1635019116;}
            else myStyles[oneStyle].leading = myLead + 3;
   //FONT CONDITIONALS
   //Garamond Pro
            if (myStyles[oneStyle].appliedFont.fontFamily== "Adobe Garamond Pro"){
                myStyles[oneStyle].appliedFont= "Traditional Arabic";
                if (myStyles[oneStyle].fontStyle== "Roman"){
                    myStyles[oneStyle].fontStyle= "Regular";}
                else if (myStyles[oneStyle].fontStyle== "Italic"){
                    myStyles[oneStyle].fontStyle= "Regular";
                    myStyles[oneStyle].skew= -15;}
                else if (myStyles[oneStyle].fontStyle== "Semibold"){
                    myStyles[oneStyle].fontStyle= "Bold";}
                else if (myStyles[oneStyle].fontStyle== "Semibold Italic"){
                    myStyles[oneStyle].fontStyle= "Bold";
                    myStyles[oneStyle].skew= -15;}
                else if (myStyles[oneStyle].fontStyle== "Bold"){
                    myStyles[oneStyle].fontStyle= "Bold";}
                else if (myStyles[oneStyle].fontStyle== "Bold Italic"){
                    myStyles[oneStyle].fontStyle= "Bold";
                    myStyles[oneStyle].skew= -15;}}
   //Minion Pro
            else if (myStyles[oneStyle].appliedFont.fontFamily== "Minion Pro"){
                myStyles[oneStyle].appliedFont= "Traditional Arabic";
                if (myStyles[oneStyle].fontStyle== "Regular"){
                    myStyles[oneStyle].fontStyle= "Regular";}
                else if (myStyles[oneStyle].fontStyle== "Italic"){
                    myStyles[oneStyle].fontStyle= "Regular";
                    myStyles[oneStyle].skew= -15;}
                else if (myStyles[oneStyle].fontStyle== "Semibold"){
                    myStyles[oneStyle].fontStyle= "Bold";}
                else if (myStyles[oneStyle].fontStyle== "Semibold Italic"){
                    myStyles[oneStyle].fontStyle= "Bold";
                    myStyles[oneStyle].skew= -15;}
                else if (myStyles[oneStyle].fontStyle== "Bold"){
                    myStyles[oneStyle].fontStyle= "Bold";}
                else if (myStyles[oneStyle].fontStyle== "Bold Italic"){
                    myStyles[oneStyle].fontStyle= "Bold";
                    myStyles[oneStyle].skew= -15;}}
   //Myriad Pro
            else if (myStyles[oneStyle].appliedFont.fontFamily== "Myriad Pro"){
                myStyles[oneStyle].appliedFont= "Yakout Linotype";
                if (myStyles[oneStyle].fontStyle== "Regular"){
                    myStyles[oneStyle].fontStyle= "Light";}
                else if (myStyles[oneStyle].fontStyle== "Italic"){
                    myStyles[oneStyle].fontStyle= "Light";
                    myStyles[oneStyle].skew= -15;}
                else if (myStyles[oneStyle].fontStyle== "Semibold"){
                    myStyles[oneStyle].fontStyle= "Bold";}
                else if (myStyles[oneStyle].fontStyle== "Semibold Italic"){
                    myStyles[oneStyle].fontStyle= "Bold";}
                else if (myStyles[oneStyle].fontStyle== "Bold"){
                    myStyles[oneStyle].fontStyle= "Bold";}
                else if (myStyles[oneStyle].fontStyle== "Bold Italic"){
                    myStyles[oneStyle].fontStyle= "Bold";
                    myStyles[oneStyle].skew= -15;}}
//Character styles
        for (unStyle=1;unStyle<myChStyles.length;unStyle++)
            myChStyles[unStyle].appliedLanguage= "Arabic";
            if (myChStyles[unStyle].fontStyle== "Italic"){
                myChStyles[unStyle].fontStyle= NothingEnum.nothing;
                myChStyles[unStyle].skew= -15;}   
arabic();

Hey!
Change this:
arabic();
into this:
app.doScript(arabic, undefined, undefined, UndoModes.ENTIRE_SCRIPT, "Apply Arabic Langauge");
Hope that helps.
tomaxxi
http://indisnip.wordpress.com/

Similar Messages

  • Is it possible to use Aperture to make a new image from two existing ones--ie, in a new jpg? I essentially want to create a collage that I can then print as a single image, rather than in a book. Any advice will be most welcome!

    Is it possible to use Aperture to make a new jpg from two existing ones? I'd essentially like to create a photo collage (without using existing templates) that I can then print as a single image, rather than in a book. Any advice will be most welcome! Thanks.

    https://discussions.apple.com/message/15678716#15678716
    (Added)
    The main point is that Aperture is used to make digital negatives as good as they can be (for the uses you define), but it does not ADD date to your digital negatives, nor does it produce NEW combination files.  For those tasks you need a Graphics program.
    Message was edited by: Kirby Krieger

  • I'v just installed creative cloud 64 bit windows. How can I make bridge the default program to upload pictures rather than lightroom?

    I've just installed creative cloud 64 bit windows.  How can I make bridge the default program to upload pictures rather than lightroom?

    Usually the default program associated with an image file extension is an image developing Program like Lightroom or an image editing program like Photoshop. If you want to change the default associated program to Adobe Bridge you would use Window's Controls Panel file association applet.

  • How to make web shortcuts use icon provided by website rather than default

    I'm a new Mac user, and I find it hard to use web shortcuts on my desktop and dock, because when I drag them from my browser to there, they all get the at sign on a spring icon, rather than the default icon provided by the website, which shows up next to the URL in the browser. Is there some setting that will allow it to use and keep that icon when I drag shortcuts?

    rjo98 wrote:
    That's a shame. It's so easy when I use my PC with Internet Explorer, I just drag from IE to the desktop, and it uses that icon by default.
    I guess it could be interpreted as a shame that you can not get the favicon to stick to the desktop, different anyway. As Thomas A Reed suggested above, the link itself can receive a custom icon.
    The advantage of creating a folder is other associated +files, receipts and links+ can be included in the stack with the link itself.
    It is a shame the PC with IE cannot add this functionality, for my purpose anyway.

  • How do I make pressing a function key do an action?

    When the user presses F5, I want to do an action. If possible, I'd like to avoid Javascript.
    Is there some way to declare to the form that I want an arbitrary function key or key-sequence to do an action?
    Thanks,
    Eli

    If you're asking about Pages for iOS (this forum is for iWork for iOS), I don't see an option to make part of an image transparent.
    If you're asking about Pages for your Mac, you can use the instant alpha tool to make the background transparent. There is a separate forum for Pages on the Mac here.

  • Refreshing a single portlet rather than the whole portal page

    Ok, here's my situation.
    I have two pdk portlets on my portal that communicate through page parameters. Portlet A has a bunch of search fields, a customer drop-down list, parts drop-down list, division, etc. Portlet B takes those parameters, queries the database, and displays the results. I would like to be able to refresh portlet B without reloading the whole portal page.
    I have onchange events on all of my drop-downs that will do a javascript post back to portal, which will in turn set my page parameters, and I see there is a 'refreshPortlet' function in a javascript file that portal provides that will refresh a single portlet based on a portletReferenceId. It is normally called when a refresh button is clicked in the portlet header, but I don't see any reason I can't call it after my javascript post, that is, if I had the portletReferenceId for the other portlet. I thought about making a hidden html table on the page that, I could fill with the portlet names and ids for each portlet as they load, that way I could reference that list from any portlet. The problem is I can't figure out where the ids are coming from. Based on the code behind the button, the function is looking for something like this 646_701285_646_1_701271, but the closest thing I can come up with is this 676114_POSTCONTENTPORTLET_467414915 which I got from PortletRenderRequest.getPortletInstance().getInstanceName(). As you can see, it's not even close. Does anyone know where the correct id could be coming from? It's got to be available to me somewhere, doesn't it?
    The only other option I can think of to accomplish my goal is to use straight up ajax to display portlet B, but that kind of defeats the purpose of portal doesn't it?
    Any help would be greatly appreciated.
    Thanks,
    Doug

    You can use Ctrl+F4 to close the current tab. I don't think that you can change the Alt+F4 action with Keyconfig.

  • Syncing and single album rather than my entire itunes library.

    I have an album I would like to move to my iphone. It is on a different computer than I normally use. I can link my iphone up but if I choose to sync with it, it will remove everything I have added from my other computer. I just want to add a single album, I don't want to sync with this second machine.
    Is there a way to simply create a playlist on the second computer and then only sync that playlist without it removing everything else I already have on the phone?
    thanks,
    ryan

    Man that is just crazy. How many of us have a PC for a work computer and a Mac at home. Obviously most people have music on both. Now, you are saying I can only pull music from one or the other. More so, I have two Macs and three PCs and due to HD space, etc... I don't want to keep all of my music on one machine. The fact that I can only bring music from one PC to another at any given time means I am going to have to setup a home network and a shared music directory so that all of my itunes can have the same files. I'll prbably need to go out and buy a huge HD to hold all of the music in a unified location. This is pretty lame since I can take my ipod anywhere and hook it to any machine and drag the files I want right onto it. That is a much preferable method. It is almost hard to believe they would have made this so restrictive. This phone is so cool and yet has so many of these potholes.

  • Copying + pasting single keyframes rather than whole fx/filters??

    Hi there -
    Does anyone know of a way to copy and paste individual keyframes between clips, eg. scale, centre etc., ..like you can in Avid? The idea, obviously, is to avoid having to copy an entire move/effect/filter and then manually adjust your keyframe values by punching in the correct numerical values.
    Any thoughts greatly appreciated....Thanks!!!

    There's really not a way to do this, however could you just put that single keyframe in a clip for pasting many times?
    Jerry

  • Can you turn on Overprint Preview in Actions rather than toggle mode

    I have an action with a number of items to do prior to releasing/proofing a file to print. I can record overprint preview using insert menu item, but this toggles to on or off depedning on what the last.
    Mac 10.8.4  CS5  15.02

    BRILLIANT! Not bumpy at all as at the end of the action all is how I need.
    I am guessing this works, because I never use pixel preview in print so that alwasy starts off. Overprint preview on our files can be on or off, before the action.
    Another issue for extra credit is the unlock all will give me this if there are no unlocked items. Not a big problem, but would like for this to not even come up. Since you proved what I believed impossible on my last questiosn, thought to give this a shot.

  • Is it possible to make the ipad remain on an app screen rather than reverting to the home screen?

    We have a credit card app on our Ipad2 that we want to remain available for use 24/7; the ipad is encased in a security holder and the 'home' button is not accessible. Therefore, we want the card app to remain as the only thing visible. Unfortunately, the ipad keeps timing out to the home screen which makes all other apps available to everyone. Short of removing all other icons, is there a way to make it stay within the credit card app?
    Thanks

    Apps don't time out.   There is no specific time interval for app usage.  If its going back to the home screen either the home button is being pressed (which you said is not possible) or the App is crashing.
    In which case its something for the developer to look into.
    You can find crash reports under Settings->General->About->Diagnostics and Usage->Diagnostic and Usage Data.
    Other than that, I'm not certain Guided Access will relaunch the App in the event that it crashes, but you may want to look into it.
    Settings->General->Accessibility->Guided Access

  • How can I make audio come out of the phone speaker rather than the standard speaker in android?

    just like the title says. is this possible? Has anyone sussessfully done this?

    With AIR 2.7, there is no way to switch between device speaker and phone  earpiece on Android and iOS. All sounds, by default, play through device speaker only.
    The link mentioned by Colin just presents a way to enable phone receiver on iOS. However thats a bug and will be rectified in future releases. So I will not encourage you to use that.

  • Make startup manager load by default on startup (rather than option key)

    I have a macbook pro 13' (late 2010 version) i am running Lion and i have windows 7 proffesional using boot camp.
    When i boot up my mac it loads Lion by default.
    I understand that to switch between the two i have to hold the option key on startup, i am then prompted for my password, and after entering it i get to the startup manager which displays the startup disks available.
    I would like to know if there is a way of getting my mac to run the startup manager (with password) by default when i boot it, rather than choose one of the installed os.
    Thanks in advance.
    Gaz

    No. However, you can install a third-party bootloader if you're willing to try it: rEFIt.
    If  you do this then you need to know that Boot Camp Assistant will no longer be able to manage the Windows partition.

  • Removing result row value for a single KF rather than all KFs in a query.

    Hi,
    Is it possible to remove the value in the result row of a query for a particular keyfigure? I want the the values in the result row for all the keyfigures except one. This particular keyfigure should have nothing in the result row. Is it possible in BEx Query Designer? Because my current setup doesnt allow me to use any other BEx tool other than query designer. Would appreciate if someone can provide me a solution for this using query designer. Helpful replies will be rewarded full points.
    Regards,
    Anurag.

    u can do that...
    enter into query designer
    open ur query
    go to columns / rows
    select ur keyfigure
    on right panel u will see properties for that particular keyfigure
    go to the Result row option
    Select CALCULATE RESULT AS
    then select SUPRESS/HIDE OPTION..
    that way u can suppress the result rows for ur keyfigure.

  • How to make .wmv files play in QuickTime Player 7 rather than 10

    I have just about had it with QuickTime Player 10 in the Applications folder
    and would rather use QuickTime Player 7 in the Utilities folder to play .wmv files.
    When I double click on a .wmv file, it opens in QuickTime Player 10 with the
    lame floating thing that blocks the view. Where and how can set 10.6.2 to use
    QuickTime Player 7 rather than QuickTime Player 10?
    The floating thing is really annoying

    QuickTime X is very new software and only Snow Leopard users have it
    A blurb on the 22-Jan-2010 issue of iClarified
    http://www.iclarified.com/entry/index.php?enid=7303
    indicates a soon to be released 10.6.3 update will contain some QuickTime X
    enhancements. I hope the enhancement fixes the floating navigation bar that
    caused me to revert to QuickTime 7.

  • Make firefox tabs auto-size similar to chrome rather than having the tab navigator arrows when the tab width is full???

    I want the tabs to auto-size/shrink when the tab bar width is full as opposed to adding the annoying extra step of navigation arrows...
    any suggestions?

    Suggestion:<br /> https://addons.mozilla.org/en-US/firefox/addon/custom-tab-width/

Maybe you are looking for

  • Form 16 error in ESS

    Hi Portal Experts , While trying to view the Form 16 link in Benefits and pay section we are getting the below error . W ehave integrated ESS /MSS 1.41 with EP and in backend able to preview the form 16 .   System connection is working fine and jco a

  • HP 6510 All in One will NOT print Black ink

    I replaced my black ink cartridge & it will not print black ink. Yes HP genuine. I have tried everything I have read on here and elsewhere and it doesnot help  I have gone to 4 different stores and bought 4 different black ink cartridges thinking per

  • ApplyJRF - what does it do in the background?

    Is there some documentation on the procedure and what it does? If you give me a link and it is directed to a blog I probably cannot get to it from my job. :( Basic questions on the direct I am looking for: Is there a package that gets extracted to th

  • PO cancelled even there is a partial quanitiy billed

    Dear All i have PO with Quantity 10 and received it then i billed it , after that the user's want to return the PO , and cancel it . they did it .but what i want to disable the cancel from the PO if there is a billed quantity . any help best regards

  • I cannot update my ipod 3G (32 gb) NO ONE KNOWS HOW TO FIX THIS.

    "iTunes could not contact the iPod software update server because you are not connected to the Internet.   Make sure your Internet connection is active and try again" This has been the plight of new ipod. I bought an iPod 3G (32 gb) used. It hadnt be