Shot in the dark... project due in 36 hours. help?

Hi everyone. I am posting this here because I have had no luck with any other program or anyone I've been able to ask (a handful of computer science students). What I am trying to do is a fairly simple operation that I would really really like to have done for my presentation friday morning. If anyone would be able to write a script, point me to a similar script, or give me a head start/ a sample script to start working with I would immensely appreciative; I don't know of any way to repay any of you but if I can find a way I will do it. My problem:
I have 5 lines. They are exactly the same line, the same x,y coordinates; they entirely overlap each other. Their only difference is that their stroke weights vary. What I am looking to do is basically find the average stroke width of these lines. Ideally the output would be in a new line with those same x,y coordinates with the new stroke weight. A text output, any output of any kind would be perfect.
I have attached a pdf visually explaining what I am trying to do to this thread.
Again, if anyone can help me in any way, I would be forever grateful. Thank you
Nick
Edit: Random side note: Today is my birthday, this would honestly be the best present I get all day!

literally, perfect. i wish i could give you more points!
edit: just so you have it, here is the final script. I needed to change a couple things but i figured it out myself!:
var doc = app.activeDocument;
var sel = (doc.selection.length > 0) ? doc.selection : doc.pathItems;
//init array to hold our lines
var myLines = [];
var lowestYCoord = null;
//init the variable that will hold our reference line(the other lines have to have similar properties to this one)
var refLine = null;
//loop through the document to find pathitems
for(j = sel.length - 1; j >= 0; j--) {
   if(sel[j].typename == "PathItem"){
          if(getConstructionPoints(sel[j]) == '') {    
                  lowestYCoord = ( lowestYCoord == null) ?  sel[j].top :  lowestYCoord;
                  lowestYCoord = ( lowestYCoord > sel[j].top) ? sel[j].top : lowestYCoord;
                  if(refLine == null) { refLine = sel[j]; }
                  myLines.push(sel[j]);
//let's loop through our lines if we have any
if(myLines.length > 0) {
    var aSum = 0;  
    for(i = myLines.length - 1; i >=0; i--) {
       if(myLines[i].stroked) {
            aSum +=  myLines[i].strokeWidth;
        if(myLines[i] != refLine) myLines[i].remove();
    var newStroke = aSum / myLines.length;
    //create our new line in the same position as our reference line defined somewhere above
    var myLine = refLine.duplicate();
    myLine.strokeColor = refLine.strokeColor;
    myLine.strokeWidth = newStroke;
refLine.remove();
function duplicatePathPoints(shp1, shp2) {
    for(j = shp1.pathPoints.length-1; j>=0;j--) {
        var pt = shp2.pathPoints.add();
        pt.anchor = shp1.pathPoints[j].anchor;
        pt.leftDirection = shp1.pathPoints[j].leftDirection;
        pt.rightDirection = shp1.pathPoints[j].leftDirection;
        pt.pointType = shp1.pathPoints[j].pointType;    
function getConstructionPoints(path) {
        var pts = path.pathPoints;
        var ctspts = "";
        var x = 0;
        if(pts.length < 3) return [];
        for(i = pts.length - 1; i>=0;i--) {
            var pt1 = (i == pts.length - 1) ? pts[0] : pts[i + 1];
            var pt2 = (i == 0) ? pts[pts.length - 1] : pts[i - 1];
            var slope = (this.getSlope(pts[i], pt1)!=null) ? this.getSlope(pts[i], pt1).toFixed(2) : null;
            var slope2 = (this.getSlope(pts[i], pt2)!=null) ? this.getSlope(pts[i], pt2).toFixed(2) : null;
            if(slope != slope2) ctspts += "|" + i + "|";
        return ctspts;
function getSlope(pt1, pt2){
        var i1 = pt1.anchor[1] - pt2.anchor[1];
        var i2 = pt1.anchor[0] - pt2.anchor[0];
        var slope = (i2 == 0) ? null : i1/i2;
        return (slope == 0) ? 0 : slope;

Similar Messages

  • Shot in the dark - Accessing page records outside the component buffer

    I know this is a shot in the dark, but I'm hoping there is some trick someone has found that allows an iScript to make use of or imitate the function 'GetRecord'. I understand the limitations of an iScript and the reasons why it has no access to things like 'GetRecord', but I'm trying to manipulate field display options from code executing in an iScript. Has anyone found a way to interact with fields on a page through peoplecode in an iScript?
    thanks,
    Paul

    Folks,
    This question has been solved by myself. Thanks.

  • Just a shot in the dark...

    Hi Guys
    Bear with me here...
    Am trying to chat with my daughter via iChat/AIM. She has latest version of AIM (5.9 ) running on XP, I have iChat 3.0.1 running on 10.4.2. She just got a new camera (Logitech Quickcam for notebooks pro) - I have iSight. Prior to her installation, I was able to invite her to a "One-Way video chat" in which we could audio but she could not see me (half way there). Since her install not only can we not "One-Way" audio, but we can not get video to work either. I have tested my iSight with all appleu3test sites and all works perfectly - have not chatted with another human...ok, I'm slow!
    When I invite her, she get the following: An upgrade is needed for AOL Instant Messenger Live Video. The upgrade will download the component, exit AIM, run the installer, and then restart AIM. When she hits "OK" the upgrade starts and then tells her she has all the necessary components. She upgraded in the beginning.
    She has done the "upgraded XP component" and the Service Pac 2 thing.
    Any recomendations... I know this sounds like a AIM problem, right?
    (and I won't add that she is also at a university with probable firewall issues AND technically challenged like dear ol' dad) - like I said, just a shot... any inSight (pun) appreciated.

    Thanks for the kind words, John
    Ralph, Defcom, and James Weston helped me start with iChat AV. As you point out, MANY users post good ideas and share their tips here. ALL are valuable, welcome, and what makes Apple Discussions the best forum I have ever encountered. Thanks for YOUR contribution, too.
    Back to your problem. Sorry 2-way video is not working for you and your daughter yet.
    My remaining thought concerns the maintenance "health" of her PC. Based on your initial statement that: "The upgrade will download the component, exit AIM, run the installer, and then restart AIM. When she hits "OK" the upgrade starts and then tells her she has all the necessary components. She upgraded in the beginning. "If this same thing happens more than once, I wonder if her PC is properly maintained or if the "upgrade" is being properly installed. Perhaps she has anti-virus or some other PC-protection software "protecting" her from doing the install.
    I no longer know enough about PCs to be of any help on this, but she might want to check this or seek help from a knowledgeable PC user who can help her.
    Based on your msg # 2.1 post to Austin, perhaps your daughter's school will fix it for her under their "support" policy?
    You have my best ideas. We shall see what Ralph offers. I see that he is now back at work here.
    Cheers,
    EZ Jim

  • Scripting: a shot in the dark

    Sorry folks, i know this is bad forum etiquette: storm in and post without lurking at all but I'm in a pinch.
    I don't even know if this is something FCP can do:
    I am making an animatic from still 2d storyboards. I want to put titles on them (the clips in my timeline) that match the filename of the clips.
    So when i cut to clip SC03_23.psd i see SC0323 in red letters in the corner pocket of my frame.
    Since the titles will = file name, is there a script I can write that can do that automatically, to everything I import or place on the timeline? or will i need to go through and add titles to my shots after I lock my picture?
    I know I could probably do it in shake. . .but i have hundreds of clips and adding an extra kink to my pipeline is about as labor intensive as adding the titles to my shots manually.
    anyway, thanks for your time.

    Welcome to the family, sorry this aitn' the answer you were hoping for, best I can think of, hope you get better advice.
    FCP is not a versatile compositor and the timecode reader will not access any metadata you may have on your clips. However, there are third party filters that can sort of do that. So, if you applied a metadata tag field in Lightroom or Aperture that described your shot, you might be able to get one of these third party filters to grab that data and blast it onto the screen.
    I have never used Shake but After Effects cannot do this to individual layers. You would have to create a comp for every item, place a text layer on top of it, and type in the text.
    bogiesan

  • Shot in the Dark (AU)

    MAde a transfer from one comouter to the next (GB and all plug ins).
    All is fine except for ONE plug in that is not giving out any sound.
    Its Global volume is on,
    It Opens up fine in the Sound Generator
    It is receiving midi signal as per GB
    The sliders and buttons work fine on the AU
    Programs shift seemlessly (Instruments).
    Any ideas?
    Before I remove it, it has a few great sounds I wished I could keep.
    Worth saving.
    Input would be greatly appreciated.

    AxYoung wrote:
    Hi,
    I accidently deleted a word documents I was working. It's not in the recycling
    bin. I know it's not likely, but does anyone have any suggestions,
    the main suggestion is to start backing up. there is really no excuse not to do it these days especially given that there is a very easy to use built in backup program - Time Machine.
    The only way to possibly maybe recover that file now is by using data recovery software like Data Rescue II or Filesalvage. neither is free and neither is guaranteed to recover the file. if you do decide to use one of those programs do so right away to maximize the recovery chances.

  • A shot in the dark question about Audit Trail

    Gurus,
    We (development team) typically provide deployment scripts which contain API calls or table inserts for OA configurations. This ensures consistency between environments and prevents Admin user error from fat-fingering. With that said, anyone have any idea if the Audit trail forms use backend API calls to write to standard tables? Or do those Audit trail forms write directly to standard tables/views?
    I feel much more comfortable calling an API rather than trying to mimic standard table inserts.
    Audit trail for base tables consist of several steps:
    1. Enable audit at application level (Intall Form)
    2. Define Audit name and define table (Groups Form)
    3. Define audit columns from table (Tables Form)
    4. Run Audit Trail concurrent job.
    I am mostly concerned about writing a script for tasks 1-3, since we can easily execute a concurrent job through FND_REQUEST. I've been looking at the FND_AUDIT* packages and none reference a "create" procedure.
    BTW, form diagnostic tool didn't supply much information.
    Any help would be greatly appreciated.
    Thanks,
    Scott

    Hi,
    Log a SR, Oracle support should be able to help.
    Regards,
    Hussein

  • Shot in the dark - Yellow Camp iCal Actions?

    I'm wondering is anyone has the *Yellow Camp iCal Actions version 2.2* that they could make available for me to download? The developer's site seems to be dead and the only version I can find online is version 2.0. Of course, What I am looking for in the actions is in 2.2.
    Any help would be greatly appreciated. Thanks very much.

    You know I even googled him and ended up finding an organisation where his wife was involved. Emailed them and they said they'd pass my email to her. Still nothing, even after a follow-up email to the organisation. Very frustrating! Think I'll have to try 2.0 on Leopard and just see if it works...
    I currently have 2.1. Is that any use to you? Can't seem to find the actual installer, mind you, but I guess just the action files themselves are good enough.

  • Shot in the dark

    Hi,
    In our school we have over a hundred iMac G3/450 computers. They are the sage, ruby, and indigo iMacs from around the year 2000. A lot of them have died. They simply won't turn on. I guess this is just old age, but before throwing them out I thought I'd post this message to see if there is anything I can do to revive them.
    Sincerely,
    Jal

    Hey Jal,
    a hundred iMac G3/450 computers. They are the sage, ruby, and indigo iMacs from around the year 2000.
    I've seen the same situation around here and currently have around 23 iMacs in my basement of around the same or even earlier vintage.
    Here's blurb on what I do:
    "I gather, restore, upgrade and repair computers on the Northshore. These computers are then donated to schools in the inner city. These are typically high needs schools. Many have no computers at all! In a typical school 98% of the kids are on Federal Food Assistance.
    The iMac in particular is very desirable in these situations:
    a) It has a small footprint and is self contained.
    b) I have a large amount of educational software that I load them up with.
    c) The kids love them. I have seen iMacs get hugged. I never see that with any other computer.
    Most of the children who are at these schools have no computers at home. In cases I'm working with now this is true for all of the children. The ones I donate provide the first hands on experience they have ever had.
    Harry Porterfield did a piece on me last year.
    http://www.vimeo.com/clip:150591
    Here's the URL to the TV station site:
    http://abclocal.go.com/wls/story?section=local&id=5097319
    So the ones that go into these schools are set up like this:
    If it's for Pre K to 2nd grade I set them up with OS 9.2.2 and SMIs of things like Living Books, Zoombini, TT2, Alphabet Express, Kid Pix 4 etc. About 30 things in all.
    If it's for older kids they get OS 10.4.11, Garage Band 2.0, Microsoft Office '04.
    These can actually be used for Video editing with early versions of iLife. Animation with Frame Thief.
    So they're not useless at all. I just gave two of them to the kids of two guys who salvage metal in the alleys around here (as well as a washer, refrigerator and water heater) If you would have seen the look on those kids' faces you'd know as I do that it was worth the few minutes of my time to set them up.
    A lot of them have died. They simply won't turn on.
    Right usually when that has happened the PAV board has died. (It could also be the battery so check that first - reset the PMU in this case)
    So I assemble all the ones that light up with the best hard drives and most
    RAM and then use those. The rest go to recycling or are used for parts (Just had to swap some speakers out of a donor machine into one who's speakers had been blown.)
    So if one of these won't light up I'll pull the HD, RAM and battery then send it for parts or recycling. My usual no good rate is around 15% - 25%. In your case that would still leave 75 to 85 perfectly usable machines.
    I used to repair the PAVs but as Scott points out this was hard and you need to know what you're doing. Often it was the flyback but you can no longer get that part.
    Richard
    Message was edited by: spudnuty

  • A shot in the dark, internet browsing

    Hello everyone,
    This question I problably already know the answer to but I thought I would ask anyone if there has been any new developments in the area of internet browsing through a Flash application.
    I know you can use third party applications to create a desktop application using an SWF, to create an internet browser, but I was wondering if anyone knew of a third party app that would work on an embeded system and do the same?
    Oh, and only using AS2 too
    Thanks in advance?

    I have used Logic as a large multi-FX for some years now. It is not as versatile as my old setup, but it is a lot easier to carry around. To create layers of sound like that, I used:
    one guitar into a line splitter/doubler. Then I can play either FX unit or both together.
    two multi-FX boxes, one Yamaha & one Roland.
    one mixing desk into a stereo PA system.
    To hear what that was capable of, visit:
    http://www.painted-music.co.uk/Music/musiccds-1a.html
    it starts quietly & builds in volume.
    This is a studio recording of Eight Delicacies. I have taken advantage of the studio to have three layers of sound at times. Live, I could only use two layers.
    If you use Logic 7 & a decent MIDI controller, it is possible to layer sounds in this way and to control various FX parameters live.
    Logic 8 will allow you to set up complex FX groups that you can switch between easily, or combine. It won't allow you to change FX parameters in real time. I miss that aspect of Logic 7 a lot.
    Mainstage will allow you to control any aspect of the FX plug-ins, but it is much harder to set up a variable signal flow to different FX groups.
    I realise that the type of music I play is not the same as the sort you are interested in, but the basic controls are similar. I offer help, but I think you might be better off with someone sat in the same room as you.

  • A shot in the Dark...

    Okay, I expect a little heat for asking this, but try to contain it :]
    Recently a user posted a request regarding a certain guitar sound. He surprisingly got a few great responses, so I'll bite:
    I am so preoccupied with the guitar sound of Robin Guthrie, that I may start to need professional help to get over it. So, does anyone have any suggestions of how Logic's great set of effects, etc, might bring one close to this sound? I realize in advance that the guitar itself is a big part of this, of course.
    http://www.youtube.com/results?searchquery=robinguthrie&searchtype=&aq=0&oq=robinguth
    Thanks for the time and higher know-how.
    Scott

    I have used Logic as a large multi-FX for some years now. It is not as versatile as my old setup, but it is a lot easier to carry around. To create layers of sound like that, I used:
    one guitar into a line splitter/doubler. Then I can play either FX unit or both together.
    two multi-FX boxes, one Yamaha & one Roland.
    one mixing desk into a stereo PA system.
    To hear what that was capable of, visit:
    http://www.painted-music.co.uk/Music/musiccds-1a.html
    it starts quietly & builds in volume.
    This is a studio recording of Eight Delicacies. I have taken advantage of the studio to have three layers of sound at times. Live, I could only use two layers.
    If you use Logic 7 & a decent MIDI controller, it is possible to layer sounds in this way and to control various FX parameters live.
    Logic 8 will allow you to set up complex FX groups that you can switch between easily, or combine. It won't allow you to change FX parameters in real time. I miss that aspect of Logic 7 a lot.
    Mainstage will allow you to control any aspect of the FX plug-ins, but it is much harder to set up a variable signal flow to different FX groups.
    I realise that the type of music I play is not the same as the sort you are interested in, but the basic controls are similar. I offer help, but I think you might be better off with someone sat in the same room as you.

  • A shot in the dark but...

    I need help with this. My PB was doing fine then all of a sudden, it starts operating really slowly...I can't explain it. I haven't installed anything new or downloaded any new files.
    I'm running OS 10.3.3 and have tried repairing disk permissions using both disk utility and cocktail, but they both take so long that I forced them to quit to get onto this forum.
    I'm not sure what to do, the only thing I can think of is that I recently (two weeks ago) installed 1GB of RAM, but the computer worked fine until today.
    I'd appreciate any help you can give.

    Okay, check this out. I think I have to take my PB to a priest because as soon as I got home, I started it up again and voila! No problem! PB started up in the normal amount of time, ran Cocktail, everything is normal.
    I also checked the memory, all of the original and extra RAM is there - 1.25GB.
    I have no idea why this just happened but I'm going to back up my data and hope this lasts!
    Thanks for your help!

  • PROJECT DUE TODAY __ NEED HELP!!!

    i posted earlier about how DVDStudio is quitting itself while rendering the menu. i think exactly what it says is rendering menu1, language menu. i sat here and watched it for 4 hours and it gets to 60%, shuts down. no file to be found, nothing. i have used the burn, format/build, and stopped that and i just want to build it. i have rebuilt, recompressed, and re-encoded this movie countless times, so please do not tell me to re-compress, encode, or import my files - that IS NOT working.
    i can't just throw it together via iDVD, as the menu has already been approved in the first proof and is what they are expecting. this just started happening this weekend, i'm not sure what's going on. PLEASE HELP!!!
    matt
    ps - dvdstudio 4, powerbook G4, external 800 gb raid drive holds all the video files and i have tried to set preferences to build to that drive and to the system drive. i have encoded via compressor AND dvd studio.

    there is no chance for me to copy it, as DVDSP shuts down too quickly.
    when i re-open the program, there is no record of my effort to build prior. everything reads completed until it reaches "rendering Menu 1, Language 1", then it takes appx 4 hours to render 60%, then it closes up.
    i have done an "updated" installation and now i am re-encoding again to try to start over. this is a very simple project. one menu consisting of 4 loops (m2v), one audio track in menu (ac3), and one text button that leads to an 8 minute long track (m2v).

  • HELP!! Flash project due monday and need help asap

    I am a student of the University of Phoenix and I am taking a multi media class, I was given an assingment to create a flash movie given a code to place in the movie and I cannot get it to work, I have one error, I also have no experiance with codes it wasn't a prereq., I need help and the Academic Advisor told me to post here, I am getting nowhere fast please help me! I will attach and hopefully someone will be able to assist me it probably is simple, but the movie needs to stop and replay with the button.
    Thank you in advance.I have been working for 3 days and getting nowhere.

    noone's going to be able to help you much with the swf (unless they are willing to decompile it).  you could copy and paste the code in this forum and probably get some help.  and, if you uploaded your fl somewhere and posted a link, you might get some help.

  • Can't update an app on the app store due to hash mismatch HELP!

    Hi, I am trying to update an app- turbo collage collage creator and when I try to update it, it starts to download but then keeps restarting the download and doesn't finish. Then, a message popus up saying The App cannot be downloaded hash mismatch.
    If anybodycan help or knows any solutions please help me thanks

    You should first uninstall the existing version (Collage Creator 2.0) from your Mac. Then, install TurboCollage from the Mac App Store. Note that Collage Creator has been renamed to TurboCollage from this update.
    Here are the steps to uninstall an application installed from the Mac App Store:
    1. Open Finder
    2. Go to Applications category on the left
    3. Drag Collage Creator to Trash to uninstall

  • Unable to check-in the BCC project

    Hi,
    I am unable to check-in the BCC project, getting below error, Please help:
    tg.repository.RepositoryException: assertion on checkin failed.
    checkin created duplicate branch head versions for repository item type /atg/commerce/catalog/ProductCatalog:media on branch 10100.
    regards,
    Alphonsa

    If you have taken a dump from somewhere and setting it up on ur local, you should cleanup the database a bit before actually deploying any project.
    I would suggest you rollback any of your current projects and run the following scripts to remove any staled/existing projects in CA.
    DELETE FROM EPUB_PR_HISTORY;
    DELETE FROM EPUB_PROC_HISTORY;
    DELETE FROM epub_proc_prv_prj;
    DELETE FROM EPUB_PROJECT;
    DELETE FROM EPUB_IND_WORKFLOW;
    DELETE FROM EPUB_PROC_TASKINFO;
    DELETE FROM EPUB_PROCESS;
    DELETE FROM EPUB_HIS_ACT_PARM;
    DELETE FROM EPUB_HISTORY;
    DELETE FROM EPUB_TASKINFO;
    DELETE FROM EPUB_DEP_LOG;
    DELETE FROM epub_file_asset;
    DELETE FROM avm_asset_lock;
    DELETE FROM dss_server_id;
    DELETE FROM dsi_server_id;
    commit;
    Now start your server again and check the deployment.
    Hopefully it should work!

Maybe you are looking for

  • Issue with list saving data after sites upgrade from sharepoint 2010 to sharepoint 2013

    Issue with list saving data after sites upgrade from sharepoint 2010 to sharepoint 2013  Newform.aspx of list:- Custom List is not saving data sometimes in the new form after 15 minutes and only blank entry record got created without saving data, eve

  • How to active my MBA?

    as the title

  • PO output : PDF file in ftp

    Dear all , I require the PO smartform o/p to be saved in an FTP location mouted on the system . Pls guide me how do i go about that . Presently i have a PO o/p type that sends an email  with pdf attachment to the specified partner ( vendor). On the s

  • Weird lines on screen plz help!

    I have a problem with lines on the screen every time im on my computer.  When I boot up there are weird black vertical lines that prevent me from reading some things, but when I get into windows they are horizontal and are just different coloured (no

  • CS3 PS PDF files for PDF Presentation . . . help!!!!

    I have made PDF presentation in previous versions of PS through automate or using Bridge. I used both jpeg and PS generated PDF files to create the presentation and never had a problem. I used the same file size and format to create a new presentatio