[JS] [CS3 onwards] Scripting Styles within folders

Hi.
This is my second attempt with this thread, as I failed to add a sufficient title last time.
http://forums.adobe.com/thread/631524?tstart=0
This is the link to the original thread...  I am hoping I am not making my error worse by doing this!
Cheers
Roy

The problem here is that JS silently looks up things if it cannot apply your current command. In the case of setting a paragraph style, you can feed it a string, but that actually gets checked against the current list of paragraph styles, and it's the style itself that gets used.
This ought to work:
myGroup = app.activeDocument.paragraphStyleGroups.item("PRO");
myDirectLinkToAStyle = myGroup.paragraphStyles.item("PRO - Product Heading :+color);
.. stuff here ..
myStory.paragraphs[ii].appliedParagraphStyle = myDirectLinkToAStyle;
Untested, untried, etc. You know the drill.
(I always type a post in full before daring to click any of the horrendous Jive formatting buttons. I find it inexplicably difficult to edit code with that weird and unpredictably-behaving Code Formatting thingamajig. Before not-that-long-ago, I simply switched to HTML mode and injected my edits straight into the correct place, but -- oh sadness! -- New and Improved Jive seems to bracket each and every single character with some "function (bladiblah) (release(whatever))" crap code.
Since the Adobe programmers seem to have grown a liking to Flash, WRITE A FLASH EDITOR for the forums! Or simply buy one -- I've seen a-plenty online Flash editors with lotsa nice features. Either way, get rid of this Jive bull.)

Similar Messages

  • Scripting Styles keyboard shortcuts

    Hi.
    I'm creating an Applescript for Indd 5.5 that will create a number of documents and add them to a book file. I'm trying to flesh out all the book's documents with as many text and object styles as I can, and ensure each document has only the swatches etc. needed for the book.
    I've managed to create text styles and groups (folders) quite easily, but I can't find a way of assigning a keyboard shortcut to a style. Typically, I will be using shortcuts on the numeric keypad, and using the command key (Mac) – Command+Num 8, for example. I've searched the web, but can't find anything that shows how to do it – only how to assign global shortcut sets for InDesign.
    Can anyone point me in the right direction?
    Thanks,
    K@

    Well, I was proposing a slightly different strategy.
    Export one style from the INDD to IDMS, and then delete
    all the extra crap that is not the style definition. That
    leaves you with about 20 lines of XML.
    Then, write your AppleScript to create a 20-line XML file
    containing those literal 20 lines, while adjusting the name
    and shortcut of the style.
    Then your Applescript can place the IDMS snippet file after it
    writes it, and then delete the temporary file. You can then
    modify the attributes of that imported paragraph style
    in our script.
    That's a little bit clunky but it shouldn't keep you from putting the
    shortcuts in your applescript code. You are just dynamically
    generating IDMS/IDML/XML from your applescript.
    You mention maybe you would prefer not to format the style within
    the script? Well, then I guess you have even more options
    available!

  • (CS3 JS) script runs differently from Scripts Panel vs. ESTK2

    First things first: INDD CS3 / Javascript
    I have a strange thing happening and am wondering if y'all have run into this as well. I have a fairly simple script (primarily just find/change queries). It works like a charm when running it from ESTK2; however, when running it from the scripts panel within INDD, it skips two of the find/change queries inexplicably. 90% of the script works the same, but there are two sections of the script that seem to just not fire.
    And yes, I have made double-sure that I am running the same script and that the one I am running from ESTK2 and from INDD are the exact same, saved versions.
    Is there a fundamental difference between running from the scripts panel and firing from ESTK2? I ran both on the same template, then undid each step-by-step, and it appears that both times the script ran the queries in the same order; however, when it hit a certain spot in the script, one version (the one fired from ESTK2) shows where the text was deleted, and the other looks like it did nothing.
    Is this something that any of you have run across as well? If necessary, I can post the code; however, I figured at this point, I would just ask the general theoretical question of why there might be a difference.
    Thanks!
    Matt Hollowell

    Thanks for the response Kasyan and Peter. I was beginning to feel like that lone person afflicted by some rare scripting illness. I am going to try and solve this later today. I am thinking maybe I need to target INDD with a statement or define an application specific variable or something to ensure that the script "knows" what it is supposed to be doing when run from the scripts panel. I am still confounded why it would run differently, and all I can think is that when it is run from ESTK2, it understands something inherently that needs to be specifically defined when run from the scripts panel.
    The other strange thing is that 90% of the script works as expected; it's just two specific find/change arguments that seem to get skipped.
    If I can figure out what is going on, I will post here, in case someone in the future runs across a similar problem.
    Matt

  • In Pages (5.5.1) can I create multiple Paragraph Styles within one paragraph?

    In Pages (5.5.1) can I create multiple Paragraph Styles within one paragraph. 
    I need to make a table of contents for my Mater's Thesis and want to use the automatic table of contents feature.  I want the first sentence of a paragraph to have a different paragraph setting than the rest of the paragraph.  Is this possible?
    Thanks!

    Nice of you to be doing this for your Mother's Thesis.
    There are several issues here:
    1. A Paragraph Style is what it says, the style for the paragraph
    2. You can format text within a paragraph by applying a Character Style
    3. Pages 5.5.1 lets you apply formatting to overall text for the T.O.C. but not parts of it and you can not retain that formatting as a Paragraph style
    So in answer to your question, no.
    You will need to create the T.O.C. manually and unfortunately as Pages 5.5.1 can't create bookmarks (just one of over 100 missing features) you will be unable to link the T.O.C. to the referred pages in the list.
    Peter
    Apple's marketing slogan:
    Pages 5.5.1 - Can't Do That!

  • Executing a Perl Script from within a Servlet

    I'm trying to call a script from within a servlet.This is the code i'm using:
    Process process = Runtime.getRuntime().exec(new String[]{"sh","-c",script,nick,pass});
    InputStream input = process.getInputStream();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    int i;
    while ((i=input.read())!=-1) {
    baos.write(i);
    System.out.println(baos.toString());
    I can`t make it work.This is the output i'm getting.
    java.io.IOException: CreateProcess: sh -c /home/script.sh user pass error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.(Win32Process.java:66)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:551)
    at java.lang.Runtime.exec(Runtime.java:477)
    at java.lang.Runtime.exec(Runtime.java:443)
    at controllers.EmailAcountCreate.doPost(EmailAcountCreate.java:34)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    Thanks in advance.

    I am facing the same problem. Could you please post the answer if you have one now. Please treat this as very urgent.

  • Errors when trying to INSERT Dreamweaver CS3 ASP scripts into MySql

    Greetings everyone,
    I am hoping that someone can shed some light on an issue I have not been able to solve in the last few days. I have a website that I had built using Ultradev, then MX then CS3, using the default ASP scripts in dreamweaver and an odbc connection to an Access Database. Everything had been working fine for the last couple of years until recently where more people were visiting my site which resulted in the slowness because i was using access. I decided to move to a MySql database and that is when I ran into issues. I was able to solve most everything accept for one issue I am having. I was hoping it would be an easy transition by changing the ODBC connections but it has not been that easy. Any page I have with an INSERT command using the default Dreamweaver CS3 ASP script results in an error. Now I can query and delete and search with no problem...it is just the INSERT that is giving me issues. Here is just a general insertion script that CS3 does by default....
    <%
    If (CStr(Request("MM_insert")) = "form1")Then
    If (Not MM_abortEdit) Then
    ' execute the insert
    Dim MM_editCmd
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_adsdata_STRING
    MM_editCmd.CommandText = "INSERT INTO commenthot (yeshot, userhot) VALUES (?, ?)"
    MM_editCmd.Prepared = true
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 2, 3, Request.Form("yeshotf")) ' adVarWChar
    MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 3, 30, Request.Form("useridf")) ' adVarWChar
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close
    End If
    End If
    %>
    When I click to submit...the error i run into is...
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [MySQL][ODBC 3.51 Driver][mysqld-5.0.67-community-nt-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' mel)' at line 1
    /fr/members/sexyoupasvote.asp, line 28
    ....Line 28 is the MM_editCmd.Execute. I notice if I put a single quotes around the ? next the the VALUE like this ('?', '?')...it does go through and the ? shows up in both fields as the data.
    ....If i put a single back quote around the column names like this (`yeshot`, `userhot`) VALUES (?, ?) I get this error and nothing gets inserted into the MySql.
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [MySQL][ODBC 3.51 Driver][mysqld-5.0.67-community-nt-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' mel)' at line 1
    /fr/members/sexyoupasvote.asp, line 28
    ...by seeing 'mel)' show up, I know it is at least passing the data to that field.
    ....when I do (`yeshot`, `userhot`) VALUES ('?', '?')...
    it goes through and inserts ? ...instead of the real data I want to use...in this case ...the number 1 and Mel.
    ...if I do (yeshot, userhot) VALUES (?, '?')...
    I get this error...
    Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
    Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
    /fr/members/sexyoupasvote.asp, line 28
    ....any idea what to modify to make it insert the corect data? Has anyone experienced this? If I can get this fixed with just this page I can probablly fix the other pages that have teh same issue.  Is there a special setting on the MySql that I should know about to allow data to be inserted? Any help would GREATLY appreciated!
    Thank you!

    Thanks for your reply!
    When it was in Access...the datatype was Text. I used a 3rd party software to convert Assess directly to my hosting MySql server. When I logged in to see the table in MySql, it is set to Varchar(3) for yeshot and Varchar(30) for userhot. There is also an extra field I used for the KEY called commentID which is set to int(11) and it is autonumbered. Under the Collation i have utf8_general_ci set on the yeshot and userhot field. Null is No on both and the Default is set to None and all 3 fields.
    I have a form I am collecting that data from which is:
    <% If (langname.Fields.Item("langname").Value)="FR" Then
             response.write("OUI!")
             else
             response.write("YES!")
             End if %>
    <input name="yeshotf" type="radio" id="yeshotf" value="1" checked>                           
                                <span class="style10">
                                <input name="submit" type="submit" id="submit" value="VOTE!">
                                </span> -
    <input name="yeshotf" type="radio" id="yeshotf" value="2">
                                <% If (langname.Fields.Item("langname").Value)="FR" Then
             response.write("NON!")
             else
             response.write("NO!")
             End if %>
                                <input name="useridf" type="hidden" id="useridf" value="<%=(hotornot.Fields.Item("membername").Value)%>">
                                <input type="hidden" name="MM_insert" value="form1">
                              <input type="hidden" name="hdwfail" id="hdwfail" value="sexyoupasvote.asp?langname=<%=(langname.Fields.Item("langname").Value)%>&membernam e=<%=(hotornot.Fields.Item("membername").Value)%>&hdwmsg=invalid">
    </form>
    ....the form has 2 radio button and 1 hidden field where I collect the username. The radio value should either be a 1 or a 2 depending on the selection by the user. I also have a captha on the form but that does not seem the cause any problem since I am not collecting any data from it. Does this help? I left the yeshot field as Text but I can change that to Numeric data... again thanks for your assistance in helping me try to figure this out.
    ...The message I am getting now is:
    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [MySQL][ODBC 3.51 Driver][mysqld-5.0.67-community-nt-log]Unknown column 'Babe1' in 'field list'
    /fr/members/sexyoupasvote.asp, line 28
    ....with this setting:
    <%
    If (CStr(Request("MM_insert")) = "form1") Then
      If (Not MM_abortEdit) Then
        ' execute the insert
        Dim MM_editCmd
        Set MM_editCmd = Server.CreateObject ("ADODB.Command")
        MM_editCmd.ActiveConnection = MM_adsdata_STRING
        MM_editCmd.CommandText = "INSERT INTO dsnrenms.commenthot (yeshot, userhot) VALUES (?, ?)"
        MM_editCmd.Prepared = true
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 3, Request.Form("yeshotf")) ' adVarWChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 30, Request.Form("useridf")) ' adVarWChar
        MM_editCmd.Execute
        MM_editCmd.ActiveConnection.Close
      End If
    End If
    %>

  • How to find Script Style for Standard Purchase Order Form "MEDRUCK".

    Hi ,
    I need to convert script style using by Sap-script form 'Medruck' to Smart form style and for this i have to find Sap-script style name for Medruck.
    If anyone have a idea about it then plz tell me.
    It's very urgent for me.
    Thanks & Regards,
    Gaurav.

    Hi Gaurav,
    If I'm not wrong, we don't have any SAP-Script Style, but when we are trying to upgrade to SmartForms simply u upgrade using smartforms transaction code, and it will convert all your character formats and paragraph formats and try to assign as SYSTEM Style in Smartforms.
    If you find the difference then you need to create SmartStyle manually and assign it.
    Thanks,
    -Pavan

  • In IE I used different levels of folders for my favourites. After importing I miss the bookmarks of folders within folders within folders etc.

    In Internet Explorer it is possible to organize favourites with folders as in firefox. In these folders you can make new folders and within those new folders. Can this tree structure be used in Firefox? After importing most of my favourites are gone, I can find no folders within folders within folders etc. So most of my favourites are not imported from IE.

    Thanks for the helpful thoughts LarryHN. I'm having a Mac guy look at my MacBook Pro in the next day or so to see what he can find out. I described the issue on the phone... and like you, he said that saving my documents to a thumb drive shouldn't affect my iPhoto library.
    One reason I bought the thumb drive was to back up my iPhoto library, but the time I got to that, it was already gone. I've thought of getting Time Machine (and have checked out other systems), but the reviews are so mixed, I'm dragging my feet on coughing up the cash right now.
    When I launch iPhoto, I only see the last few weeks' worth of photos. Oddly, photos I imported 3 weeks ago appear, but are in a folder dated November 2012--when I know I took those and imported them in January 2013. So that's weird...
    When I got to iPhoto Library, I have an Auto Import folder with nothing in it. "My Pictures" folder has nothing as well. I did hold down the option key while opening up iPhoto, but only my recent library (a few weeks' worth of photos) appears. I'm using iPhoto 2011 (6.2.3). I can only hope my Mac guy can help...

  • Create SAP Script Style and link to Script

    Hi,
    How to create SAP Script Style through SE72...and how to implement it to Script..
    Means where to implement to Script..for ex. below code is script code of ZMEDRUCK...
    /: INCLUDE &T166P-TXNAM& OBJECT &T166P-TDOBJECT& ID &T166P-TDID& LANGUAGE &EKKO-SPRAS& PARAGRAPH IX
    Please tell me where i use that style...
    Regards.

    Hi.
    Maybe, I think that the purpose of style is to use it with SO10.
    Therefore, it doesn't use it in SAP script.
    SAP script copies with SE71 and changes.

  • Shortcut for selecting multiple files within folders

    I'm archiving a load of work on to CD and deleting the files off of my server but keeping the folders on there for reference.
    Currently, I am having to SHIFT + click / COMMAND + click &drag to select these files and it is taking me forever.
    Is there a keyboard shortcut that allows me to select all files within folders rather than just a select all which will select the folders aswell?

    I would switch to list view, then click on the "Kind" column which will group the folders together.  Now you can click and drag to select a large range of files, excluding the folders, or you can click on the first file, the Shift click on the last file to select a large range of files.  At most you would need to do this twice.  Once for files listed above folders, and once for files listed below folders.
    If you want to use the Terminal, there are powerful Unix commands that can do this, however, that same power when misused can wipe out your disk :-)

  • Is there a means to get an item count within folders in Yosemite?

    Is there a means to get an item count within folders in Yosemite?

    Yes.
    Turn on 'Show Status bar'

  • How do I created multiple folders within folders in "Photo"

    How do I created multiple folders within folders (subfolders) in "Photo".  It happens in the first level when I use the Albums folder, but thereafter it doesn't allow me to create another folder within the folder.  I can also not drag a folder into another, after the first level of folders.  Please help.

    Yes you can.  Click once on the top folder and use the File ➙ Create Folder menu option.  A new folder will be created inside the selected folder:

  • Ordering albums within folders

    When I drag albums within folders sometimes they go to where I want them, sometimes they just snap back to the top of the list. From other fora this seems to be a definite bug.
    1) Anybody know otherwise?
    2) There used to be an option to report bugs it's not leaping out at me today.
    Any anydeas anyone?
    cheers
    d.

    Thanks Frank
    It's ticked 'Manual'. But you got me thinking. So I ticked by 'Kind' - just to force it to toggle - and then rearranged manually. It's behaving itself now and I can move things where I want.
    Thanks muchly!
    d.

  • Different Footnote Styles within one document

    I work in InDesign 5.5. Currently I'm working on a project that requires different footnote styles within one document (1, 2, 3, . . . and a, b, c, . . .). How can I set them up as different styles? If I make a change in the Document Footnote Style section, all the footnotes are changing, but I need them different for different sections. How do I do that? Your help is appreciated. Thank you.

    I'm working on a book interior. The book interior has two sections, a intro section and a regular text section. For the intro section footnotes should be styled as a., b., c., etc. and for regular text the footnotes should be styled as 1., 2., 3., etc. It seems though that I can only select one style in the Document Footnote Style section, but I need two different styles. 

  • Files Not Sorting Within Folders

    I have my working AppleWorks files on my external HD. Recently the files within folders donot sort. As a test I changed a file name staring with an M to an A. The file did not sort to the top of the list. As far as I can tell nothing has changed within my system. The files on my system HD are OK. The other files on the external HD are OK - only the AW files are wrong.
    Under the "view" options the name sort is only available for the Desktop. When I open the external HD or highlight a folder the name sort option is not available. I must be missing something but what..
    Bob61

    Problem solved. Clicked on the name column and went from there. So soon we forget!!Bob61

Maybe you are looking for

  • Agent Phone is not ringing (outbound)

    Hi, I am using ICM 7.5.7. I have configured agent based campaign for outbound dialing. When dialer place any call to agent desktop agent can accept it and the call is also going to the customer. Both of they are able to talk each other. Here the issu

  • Why is Adobe Muse not spell checking?

    So I am building a site on Adobe Muse CC and I noticed the program is not spell checking as I write.  I purposely misspelled words to see if the spell checker would put the red squiggly line underneath misspelled words but it doesn't.  I have searche

  • Data Migration for Responsibilities

    Hello Everyone, I wanted to migrate responsibilities from our legacy systems to SAP C4C and for that I am using standard migration template available in C4C but unfortunately the file size which we have after filling this template is more than the si

  • Using Chrome beta, fullscreen flash videos not fullscreening Chrome

    └─> yinfo google-chrome-beta Name : google-chrome-beta Version : 24.0.1312.35-1 Some recent update seems to have done this: http://i.imgur.com/IspAE.png   Hitting fullscreen on a flash video will make it fullscreen within Chrome, but Chrome stays win

  • How dynamically get an agent f a level-by-level workflow after PO changed

    Hi  all:      I'm trying to create a level-by-level workflow after PO  changed, but how dynamically get an agent and how assign it to task dynamically?     Thank you very much!!!