Trying to calculate value based on rounding up and then calculate date range excluding weekends..

Hi
I am creating a simple design studion project request form where the user can enter how many photographs need to be ordered. I am calling this field 'NumImages'. Then once the data is entered, another field (I am calling this NumDaysImage) will be calculated based on the fact that no more than 5 photographs can be shot per day. So, 1-5  photos = 1 day. 6-10 photos = 2 days. 11-15 photos = 3 days etc. I do not need to calculate part days, so 6 photos is the same as 10 i.e. 2 days.
Once I have calcuated 'NumDaysImage', I then need to calculate an end date called 'DateDue'. The start date is entered by the user in the field 'DateStart'.
I know this is not going to be easy, but how can I calculate 'DateDue' based on a Mon-Fri working week, and ideally excluding UK public holidays?
Also on the form is a value 'NumDays' that is the number of days for designing the brochure for the photos. This value I have calculated already, but it will need to be added to 'NumDaysImage' to get a total number of production days that is then used to calculate 'DateDue'.
Any help will be greatly appreciated. Thanks.

JavaScript has the Math.ceil method which rounds up a number to the next integer if it is not an integer.
Dates are more complicated calculation as the starting date needs to be converted to a number and then one can calculate the ending date and test that date to see if is a Sunday or Saturday. Do intervening weekends add to the number of days for processing.

Similar Messages

  • How to get ATINN value based on material number and Class Type ?

    I have below SELECT stmt code which gives the correct value of atwrt based on materil no and ATINN.
    However in quality system, it is failing because in quality system "atinn" value is not 0000000381. It is different.
    So how can I get ATINN(Internal characteristic) value based on material number and Class Type?
    -Obtain the batch characterstic value for the Material******************
      SELECT atwrt
        UP TO 1 ROWS
        INTO v_charvalue
        FROM ausp
       WHERE objek = mcha-matnr
         AND atinn = '0000000381'   " 'US80_FRENCH_ON_LABEL'
         AND klart = '001'.
    THANKS N ADVANCE.

    Hi SAm,
    use the Below function module to get the Atinn for Atwrt for thr Class and MAterial combination..
    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
          EXPORTING
            classtype          = '023'       "Class type
            object             = w_object  "Material number with Leading zeros
            no_value_descript  = 'X'      "Default X
            objecttable        = 'MCH1'    "Table name Mara or MCH1 or MARC
          TABLES
            t_class            = t_class   "It return the Batch class available for the above combination
            t_objectdata       = t_char  "Return Batch characteristics(ATWRT) and their value ATINN in this table
          EXCEPTIONS
            no_classification  = 1
            no_classtypes      = 2
            invalid_class_type = 3
            OTHERS             = 4.
    Regards,
    Prabhudas

  • SQL Query find month/year and then calculate difference from start date

    Hi All,
    Assume I have a table with a column Start_Date. I like to know how we can build a query to so we can find the end of the month date based on the start_ date and then calculate the difference
    For example lets say we have a date 12/06/2014 and now based on this we should get the end of the month date which is 30/06/2014. Now we can get the difference which is 18 days.
    Thanks

    Hi Jaggy99,
    According to your description, you need to get the date difference between a given date and the last day of that month, right?
    In this case, please try the query below.
    SELECT GETDATE() AS [CURRENTDAY], DATEADD(DAY,-1,DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)) AS [LASTDAY],
    DATEDIFF(DAY, GETDATE (), DATEADD(DAY,-1,DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0))) AS [DIFFERENCE]
    Regards,
    Charlie Liao
    TechNet Community Support

  • TS1363 My iPod Nano 7th Generation couldn't be detected by iTunes when I plugged in. I tried resolving the issue by uninstalling the iTunes and then install it back again but yet still the same problem exist. Can you please help me to solve this issue?

    My iPod Nano 7th Generation couldn't be detected by iTunes when I plugged in. I tried resolving the issue by uninstalling the iTunes and then install it back again but yet still the same problem exist. Can you please help me to solve this issue? I have already updated to the latest version of iTunes on my Windows 8 and I cannot synchronize my iPod for the time being. Please do help me to solve this problem. Thank You.

    uninstall all iTunes,5 programes,this worked for me after reinstall them

  • How to copy and paste the graphics from illustrator to MS word. What I tried is exporting in png with highest resolution and then inserting in to word. This loses a bit of resolution in comparison to direct copy and paste as EMF.  But if I do a copy and p

    How to copy and paste the graphics from illustrator to MS word. What I tried is exporting in png with highest resolution and then inserting in to word. This loses a bit of resolution in comparison to direct copy and paste as EMF.  But if I do a copy and paste, and then take a print of the document, all the graphs and text is printed upside down, flipped back.

    Use the Pencil Tool
    alex
    adrian stock wrote:
    > How to copy and paste a single pixel
    >
    > I want to copy a single pixel and then paste it in the
    position of
    > another pixel in the same image.
    >
    > (This is in effect changing the colour of the target
    pixel, isn't it.
    > But in my case copying an existing pixel seems simpler
    than selecting a
    > colour from the swatch or using the colour picker.)
    >
    > What is the most efficient way of doing this?
    >
    > I tried to select one pixel with the marquee tool. Then
    copied it with
    > control-C, but then how do I select the target pixel and
    paste with
    > control-V?
    >
    > Thanks for your help.
    >
    > Adrian
    >

  • For the past few hours I have been trying to download ios 7.0.4 from itunes onto my iPhone after trying many times it would give me a error saying network failed! then i tried to download Ios 7.0.4 manually and then put it on but it keeps failing?

    For the past few hours I have been trying to download ios 7.0.4 from itunes onto my iPhone after trying many times it would give me a error saying network failed! then i tried to download Ios 7.0.4 manually and then put it on but it keeps failing? i have tried everything that i have came across and nothing seems to work please help!

    I venture to say you have a Windows PC.
    If so, before beginning the download try temporarily disabling your antivirus, anti-adware, anti-spyware, and any other anti-whatever that is required with the insecure OS your computer is running.

  • I've can't open any applications on my Mac ! I tried to delete some files from safari (history) and then none of the apps including iphoto, safari, mail, facetime. I don't know how to fix it, help ? any idea ?

    I've can't open any applications on my Mac ! I tried to delete some files from safari (history) and then none of the apps including iphoto, safari, mail, facetime. I don't know how to fix it, help ? any idea ?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output andWi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • HT204088 When trying to update an app, it partially downloads and then displays the message "unable to download item" Please try again later. This happens on any app I try. I have tried deleting the app and reinstalling with same results. What can I do?

    When trying to update an app, it partially downloads and then displays the message "unable to download item" Please try again later. This happens on any app I try. I have tried deleting the app and reinstalling with same results. What can I do?

    I have the same thing happening on my iPod Touch 5th gen. Been happening for at least a month. I have updated to the most recent version of iOS which hasn't solved the issue. Must be a bug that they didn't get around to resolving yet, a year later. Really annoying to have it pop up when you are in the middle of a game though.

  • Have downloaded new Lightroom 5.4 from CC. When trying to launch am getting following error message and then Lightroom crashes: "an error occurred when attempting to change modules". Can't find a thread which relates to this error message.

    Have downloaded new Lightroom 5.4 from CC. When trying to launch am getting following error message and then Lightroom crashes: "an error occurred when attempting to change modules". Can't find a thread which relates to this error message.

    Hi 99jon,
    Many thanks for that. Had been going through this list yesterday and now again today:
    Ref  Solution 1: Lightroom is at its latest update
    Ref  Solution 2: It's interesting how I cannot find the Preferences file anywhere on my mac. (new mac pro, OS 10/9.2) . . .
    Ref  Solution 3: Lightroom doesn't allow me to do anything after the error message appears
    Ref  Solution 4: don't have any Nik Software plug-ins
    Ref  Solution 5: checked permissions and changed all to "Read & Write" - makes no difference
    Ref  Solution 6: I don't have a different user account on my mac.
    Not sure what else to do.

  • Calculate value based upon checkbox selection

    G'day people,
    I've got myself a bit stuck on a job I've got here, this javascript is getting the better of me.
    The idea is that this script takes the sub total, and adds a creditcard surcharge (as a percentage) based upon a checkbox selection, then spits out the value to be entered into another field.
    If anyone could have a quick look over the following and let me know where I've gone wrong, it would be appreciated.
    var subtotal = this.getField("SubTotal").value;
    var mastercardTick = this.getField("MasterCard");
    var visaTick = this.getField("Visa");
    var amexTick = this.getField("Amex");
    var surcharge = this.getField("CreditSurcharge").value;
    var creditcard = this.getField("PayCredit").value;
    if (creditcard.value === "Off") {
         event.value = 0;
    } else {
              if (mastercardTick.value === "Yes") {
                 surcharge.value= (1.2 / 100) * subtotal.value;
        } else if (visaTick.value === "Yes") {
                 surcharge.value = (1.2 / 100) * subtotal.value;
        } else if (amexTick.value === "Yes") {
                   surcharge.value = (3.75 / 100) * subtotal.value;
        } else {
              event.value = 0;

    Thanks George, I've given this a whirl and got very close... I got a NaN error, and found I was calling "SubTotal" a value twice, which was playing funny buggers!
    I've got rid of one part (the if creditcard.value === "Off") as it wasn't acting like it should. I think I had to put it in a seperate function, to be called seperately then the rest of the code... However, I need to get the job out and it wasn't crucial.
    Thanks for your help mate, appreciated.
    For anyone else that's interested, amended code is as follows:
    var subtotal = this.getField("SubTotal");
    var mastercardTick = this.getField("MasterCard");
    var visaTick = this.getField("Visa");
    var amexTick = this.getField("Amex");
    // var surcharge = this.getField("CreditSurcharge").value;
    var creditcard = this.getField("PayCredit").value;
              if (mastercardTick.value === "Yes") {
                 event.value = (1.2 / 100) * subtotal.value;
        } else if (visaTick.value === "Yes") {
                 event.value = (1.2 / 100) * subtotal.value;
        } else if (amexTick.value === "Yes") {
                   event.value = (3.75 / 100) * subtotal.value;
        } else {
              event.value = 0;
    Not the nicest, but hey, it worked.

  • How to calculate value based on two fields & set that 3rd on (KFFfields)

    Hello Gurus,
    I have a requirement customization in which, in an OAF page, tableLayout: (HrSitKeyFlex) having 3 fields 1)Days of Trainging 2)No of days Trainging hours 3)Total Duration when user enter the values for two fields say 'Days of Trainging' and "No of days Trainging hours "and immediately on tab out, the 3rd field should be popluated as rate*Toatal'.
    tableLayout: (HrSitKeyFlex)
    1)Days of Trainging ( 1DAY)
    2)No of days Trainging hours (4Hours)
    3)Total Duration (calculate 1*4=8)
    Is there a way, we could capture the tab out event? Or any way we could achieve this?
    This is really urgent.
    If anyone can help.
    Regards,
    Srini

    Hello,
    1. Firstly set the fire partial event of 2nd column field.
    2. Capture the event in PFR method.
    3. After Capturing event, make a row reference object.
    4 Now store the value of 1st column field and 2nd column field in variable.
    eg. String str= row.getAttribute("Ist Column Name")+"" and String str1= row.getAttribute("2nd Column Name")+""
    5.Convert these string value into integer
    eg. int x=Integer.parseInt(str); and int y=Integer.parseInt(str1)
    6. calculate the value in the integer variable on the basic of these two value
    eg. int z = x*y
    7 Assign the value to 3rd column after converting it into string
    eg. row.setAttribute("3rd Column Name", string variable);
    when u tab out from 2nd column, the calculating value will be assign to 3rd column.
    Regards,
    Manish Chawla
    Edited by: ManishC on Dec 17, 2012 10:36 AM

  • Level Based vs. Value Based hier: advantages, disadvantages and limitations

    Could someone give an overview about the advantages, disadvantages and limitations when comparing OLAP Level to Value based hierarchies?
    Thanks,
    Marcio

    OLAP can handle both types of hierarchies. No performance advantage using one over the other (while loading cube or querying).
    If you are "pushing" dimensional-security inside OLAP, in that case also it does not matter.
    Cube-based MVs (with query-rewrite) can only be created if the hierarchies are level-based. Are you going to need that?
    Generally there are other "non-olap" factors:
    (#1). Which reporting tool will be used. Does it provide better reporting capabilities if the source is parent-child or level-based?
    (#2). Are there any reporting requirements that will need "level" information when selecting data.
    (#3). Are there are any security requirements that will be handled in "reporting-layer" which will need level-based information.
    Although in case of (#1) and (#2), you can "expose" an olap's parent-child hierarchy as "level-based" hierarchy to the reporting tool using internal GID (grouping-id) information.
    OBIEE 11.1.1.5 (and future versions) works well with OLAP metadata, and with any type of hierarchy in olap.
    For other reporting tools, you have to see what features are available.
    In short, its the source system, the reporting tool and the reporting requirements that will dictate what type of hierarchy should be stored in OLAP.

  • Calculate percrentage based on 2 column and one filter

    Hi,
    I am looking for a way to compute percentage based one two column and 1 filter but i have a problem when every thing is checked on my filter.
    The table as follow is my example:
    ID
    cat1
    cat2
    number
    total
    pct
    1
    a
    aa
    5
    40
    13%
    1
    a
    ab
    20
    40
    50%
    1
    a
    ac
    15
    40
    38%
    1
    b
    ba
    12
    47
    26%
    1
    b
    bb
    20
    47
    43%
    1
    b
    bc
    15
    47
    32%
    2
    a
    aa
    9
    45
    20%
    2
    a
    ab
    16
    45
    36%
    2
    a
    ac
    20
    45
    44%
    2
    b
    ba
    10
    50
    20%
    2
    b
    bb
    20
    50
    40%
    2
    b
    bc
    20
    50
    40%
    I create a power table as follow:
    Filter: column ID
    Axis: cat1 and cat2
    values: pct
    The problem is when I want to select all my data in my filter, a sum/mean is done for pct but the results are wrong. Did I missed something ? Is there a way to correct the problem ?

    Hi mi jo,
    It appears that you have created your percentage as a Calculated Column and what you actually want is a Calculated Field.
    You can create a Calculated Field by clicking on the Power Pivot ribbon and using a DAX formula similar to the following:
    Percentage:=DIVIDE(SUM(TableName[number]), SUM(TableName[total]))
    I have formatted this Calculated Field as a percentage and used it to create a Pivot Table:
    Is this what you were after or have I misunderstood the problem?
    Edit: Just took a quick look at the workbook and can see that the pct column is coming in as a fixed value for a row. The above solution should help. A best practice would be to first create a Calculated Field for each of the number and
    total columns such as...
    Sum of Number:=Sum(TableName[number])
    And...
    Sum of Total:=Sum(TableName[total])
    And then finally update this DAX formula:
    Percentage:=DIVIDE(SUM(TableName[number]), SUM(TableName[total]))
    To this...
    Percentage:=DIVIDE([Sum of Number], [Sum of Total])
    Regards,
    Michael Amadi
    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
    Website: http://www.nimblelearn.com
    Blog: http://www.nimblelearn.com/blog
    Twitter: @nimblelearn

  • Crearte folders based on file name and then do action

    I've written this in the best possible step to step way as possible buti've no idea how to pull it altogether as a script. Hopefully its all there, just let me know if its still not clear, I would love the help if anyone can help sort this out for me.
    Many Thanks
    Matt
    -there is a folder on the desktop called Season_SSxx_PSD where xx = a number
    --This folder contains a quantity of PSD files that need to be processed the same but placed in different locations.
    set theDesktopFolder to "Hal 9000:Users:matthew:Desktop"
    set folderName to (folder of theDesktopFolder whose name starts with "SE")
    --From the folderName
    --set the seasonNumber to the item that follows Season_ and is before _PSD (the Season number should be SS13  but can change)
    --Look at all files of folderName
    --Files can be named like the following.
    -- SE_BH70NW01234BM4BM
    -- SE_BU40NW01234BM4BM
    -- SE_ES20NW01234BM4BM
    -- SE_DV25NW01234BM4BM
    -- SE_DJ30NW01234BM4BM
    -- SE_RA30NW01234BM4BM
    -- SE_FR10NW01234BM4BM
    -- SE_TM15NW01234BM4BM
    -- SE_WA35NW01234BM4BM
    -- Now set the brandIdentifier to Item that follows SE_ of the file names of the folderName
    --Convert brandIdentifier to realName
    --BH = BigandHuge
    --BU = Buttons etc..
    -- Now create the folders
    --set up names to destination folders and create over Network for FTP collection (based on a mounted drive)
    --set this_ftp_folder to "Impulse:"
    --set ftpSeasonNumberFolder to my getFolderPath(seasonNumber, this_ftp_folder)
    --Or Impulse:SS13:
    --set ftpBrandFolder to my getFolderPath(realName, ftpSeasonNumberFolder)
    --Or Impulse:SS13:BigandHuge:
    --set ftpBrandFolder_High_Res to my getFolderPath(realName & seasonNumber & "_HR", ftpBrandFolder)
    --Or Impulse:SS13:BigandHuge:BigandHuge_SS13_HR:
    --set ftpBrandFolder_High_PNG to my getFolderPath("_PNG", ftpBrandFolder_High_Res)
    --Or Impulse:SS13:BigandHuge:BigandHuge_SS13_HR:PNG:
    --then the following
    --Impulse:SS13:BigandHuge:BigandHuge_SS13_HR:JPG:
    --Impulse:SS13:BigandHuge:BigandHuge_SS13_LR:PNG:
    --Impulse:SS13:BigandHuge:BigandHuge_SS13_LR:JPG:
    --Its these last 4 that will be used later.
    --then all files begining with BH in the folderName  do this photoshop action and save in the folders created from --above, then move on to the next file begining with BU create the relevant folders and then do the action as --before and so on.

    Cool that sorted the folder creation out without an issue, many thanks.
    Just struggling to pin the photoshop part in.
    property type_list : {"8BPS"}
    property extension_list : {"psd"}
    script o
              property theseNames : {}
    end script
    -- empty log file
    do shell script "echo  'Files not processed in Photoshop :'  > ~/Desktop/LogPhotoshopError.txt"
    set noError to true
    --at the beginning of the script, ask whether to replace or skip existing files? to apply to all?
    --use the result for the if file exists?
    display dialog "Should I replace or skip exisiting files?" buttons {"Replace", "Skip (Faster)"} default button 2 with icon 1
    set skipFiles to (button returned of the result) is "Skip (Faster)"
    set theDesktopFolder to "Hal 9000:Users:matthew:Desktop"
    tell application "Finder" to set seFolder to (folders of folder theDesktopFolder whose name starts with "SE")
    if seFolder is not {} then
              set seFolder to item 1 of seFolder
              tell application "Finder" to set tName to name of seFolder
              set seasonNumber to my getText(tName) -- get Season Number
              if seasonNumber is not "" then
                        set list1 to {"BH", "BU", "ES", "DV", "DJ", "RA", "FR", "TM", "WA"}
                        set list2 to {"BHS", "Burtons", "DaisyAndEve", "Diva", "DorothyPerkins", "DorothyPerkins", "Freedom", "TopMan", "Wallis"} -- you must complete this list ***
                        set tc to count list2
                        repeat with i from 1 to tc
                                  set brandIdentifier1 to item i of list1
                                  set brandIdentifier to item i of list2 -- the real name
      --first item = all files begining with BH
                                  tell application "Finder" to set theseFiles to (files of seFolder whose name starts with "SE_" & brandIdentifier1) as alias list
                                  if theseFiles is not {} then
      --local Folders
                                            set this_local_folder to "Images:2012-2013"
                                            set localSeasonNumberFolder to my getFolderPath("SS" & seasonNumber, this_local_folder)
                                            set localSeasonFolder to my getFolderPath(brandIdentifier, localSeasonNumberFolder)
                                            set localSeasondFolder_PSD to my getFolderPath("PSD", localSeasonFolder)
      --  *** Now create the folders ***
                                            set this_ftp_folder to "Impulse:"
                                            set ftpSeasonNumberFolder to my getFolderPath("SS" & seasonNumber, this_ftp_folder)
                                            set ftpBrandFolder to my getFolderPath(brandIdentifier, ftpSeasonNumberFolder)
                                            set ftpBrandFolder_High_Res to my getFolderPath(brandIdentifier & "_SS" & seasonNumber & "_HR", ftpBrandFolder)
                                            set ftpBrandFolder_Low_Res to my getFolderPath(brandIdentifier & "_SS" & seasonNumber & "_LR", ftpBrandFolder)
      --Use the folders below within Photoshop
                                            set ftpBrandFolder_High_PNG to my getFolderPath("PNG", ftpBrandFolder_High_Res)
                                            set ftpBrandFolder_Low_PNG to my getFolderPath("PNG", ftpBrandFolder_Low_Res)
                                            set ftpBrandFolder_High_JPG to my getFolderPath("JPG", ftpBrandFolder_High_Res)
                                            set ftpBrandFolder_Low_JPG to my getFolderPath("JPG", ftpBrandFolder_Low_Res)
      --- *** end create the folders ***
                                            repeat with i in theseFiles
                                                      set tFile to i as string
      --taking the folder identify which process it must follow.
                        if brandIdentifier is equal to "BHS" then
                                  try
                                            tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
                                  on error
                                            set o's theseNames to {} -- no psd files or "8BPS"
                                  end try
                                  set numOfNames to (count o's theseNames)
                                  repeat with j from 1 to numOfNames
                                            set thefile to theFolder & ":" & (item j of o's theseNames)
                                            --    B H S    Folder Photoshop Process
                                            set thisName to (item j of o's theseNames)
                                            tell application "Finder"
                                                      set t_ext to name extension of file thefile
                                                      if t_ext is not "" then set thisName to text 1 thru -((count t_ext) + 2) of thisName
                                                      set b to exists file (localSeasondFolder_PSD & thisName & ".psd")
                                            end tell
                                            if not b or (b and not skipFiles) then -- not exists file or file exists and "replace" (continue the rest of the script).
                                                      tell application "Adobe Photoshop CS5.1"
                                                                -- I remove the command activate, Photoshop stay in background
                                                                set ruler units of settings to pixel units
                                                                try
                                                                          open (alias thefile) showing dialogs never
                                                                          set origName to name of current document
                                                                          set myOptions to {class:JPEG save options, quality:12}
                                                                          set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
                                                                          tell current document
                                                                                    --If the quick mask mode has been left on then delete the channel Quick Mask
                                                                                    if (quick mask mode) then delete channel ¬
                                                                                              "Quick Mask"
                                                                                    --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
                                                                                    if (exists layer "Original Layer") then ¬
                                                                                              tell layer "Original Layer" to set name to "Original Image"
                                                                                    save in (localSeasondFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
                                                                                    (delete layer "Original Image") flatten
                                                                                    resize image resolution 300 resample method none
                                                                                    --sharpen image
                                                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                                                    save in (ftpBrandFolder_High_JPG & name) as JPEG with options myOptions without copying
                                                                                    --Prepare for Low RES by resetting image history
                                                                                    set current history state to history state 3
                                                                                    flatten
                                                                                    resize image width 1348
                                                                                    resize image resolution 300 resample method none
                                                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                                                    --add save to lowResFolder with same options
                                                                                    save in (ftpBrandFolder_Low_JPG & name) as JPEG with options myOptions without copying
                                                                                    close saving no
                                                                          end tell
                                                                on error
                                                                          set noError to false
                                                                          my myLogs(thefile) -- write path to log file in Desktop
                                                                          try
                                                                                    close saving no --if exists, close current document
                                                                          end try
                                                                end try
                                                      end tell
                                            end if
                                  end repeat
                                  --End BHS
                                            --taking the folder identify which process it must follow. W A L L I S
                        else if brandIdentifier is equal to "Wallis" then
                                  try
                                            tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
                                  on error
                                            set o's theseNames to {} -- no psd files or "8BPS"
                                  end try
                                  set numOfNames to (count o's theseNames)
                                  repeat with j from 1 to numOfNames
                                            set thefile to theFolder & ":" & (item j of o's theseNames)
                                            --    W A L L I S     Folder Photoshop Process
                                            set thisName to (item j of o's theseNames)
                                            tell application "Finder"
                                                      set t_ext to name extension of file thefile
                                                      if t_ext is not "" then set thisName to text 1 thru -((count t_ext) + 2) of thisName
                                                      set b to exists file (localSeasondFolder_PSD & thisName & ".psd")
                                            end tell
                                            if not b or (b and not skipFiles) then -- not exists file or file exists and "replace" (continue the rest of the script).
                                                      tell application "Adobe Photoshop CS5.1"
                                                                -- I remove the command activate, Photoshop stay in background
                                                                set ruler units of settings to pixel units
                                                                try
                                                                          open (alias thefile) showing dialogs never
                                                                          set origName to name of current document
                                                                          set myOptions to {class:JPEG save options, quality:12}
                                                                          set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
                                                                          tell current document
                                                                                    --If the quick mask mode has been left on then delete the channel Quick Mask
                                                                                    if (quick mask mode) then delete channel ¬
                                                                                              "Quick Mask"
                                                                                    --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
                                                                                    if (exists layer "Original Layer") then ¬
                                                                                              tell layer "Original Layer" to set name to "Original Image"
                                                                                    save in (localSeasondFolder_PSD & origName) as Photoshop format with options myPSDOptions without copying
                                                                                    (delete layer "Original Image") flatten
                                                                                    resize image resolution 300 resample method none
                                                                                    --sharpen image
                                                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                                                    save in (ftpBrandFolder_High_Res & name) as JPEG with options myOptions without copying
                                                                                    --Prepare for Low RES by resetting image history
                                                                                    set current history state to history state 3
                                                                                    flatten
                                                                                    resize image width 1020
                                                                                    resize image resolution 300 resample method none
                                                                                    filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}
                                                                                    --add save to lowResFolder with same options
                                                                                    save in (networkBrandFolder_Low_Res & name) as JPEG with options myOptions without copying
                                                                                        close saving no
                                                                          end tell
                                                                on error
                                                                          set noError to false
                                                                          my myLogs(thefile) -- write path to log file in Desktop
                                                                          try
                                                                                    close saving no --if exists, close current document
                                                                          end try
                                                                end try
                                                      end tell
                                            end if
                                  end repeat
                                  --End W A L L
                          end if
    end if
    if not noError then do shell script "/usr/bin/open  ~/Desktop/LogPhotoshopError.txt'"
    on myLogs(t)
              try
                        do shell script "echo " & (quoted form of t) & ">> ~/Desktop/LogPhotoshopError.txt'"
              end try
    end myLogs
    on getText(t)
              set {oTID, text item delimiters} to {text item delimiters, "_"}
              try
                        set r to ""
                        set r to text -2 thru -1 of (text item -2 of t)
              end try
              set text item delimiters to oTID
              return r
    end getText
    on getFolderPath(tName, folderPath)
              tell application "Finder" to tell folder folderPath
                        if not (exists folder tName) then
                                  return (make new folder at it with properties {name:tName}) as string
                        else
                                  return (folder tName) as string
                        end if
              end tell
    end getFolderPath

  • Calculate number of times a name appears within a date range.

    Hello,
    I am actually using the iPad version but I assume the formula will be the same. Say I have a date in column A and a list of names in column B. What would the formula be to calculate the number of times a specific name appears in a date range.
    Thank you

    If C2 = the minimum date of the range
    C3= the maximum date of the range
    and you are looking for John as the name
    =COUNTIFS($A,">="&C2,$A,"<="&C3,B,"john")
    which counts cells where A>=the min date and A<=the max date and B="john"

Maybe you are looking for

  • Getting double intercompany invoice from one STO orders

    Have you already implemented the following flows and if yes how ? I would like to build an intercompany STO between company A plant 1 and company B plant but with a 3rd company C responsible of the order, That means that i would like to get 2 interco

  • Lines In Images?

    I've been using the Adobe DPS for a few months, and I've noticed with the last update that there are lines that go across a few of my images within articles. Is there a way to fix this, or am I just going to have to deal with this from now on? Also,

  • Field Order Problem? Maybe?

    Hi, I have been using DVD Studio Pro and have never encountered a problem such as this one. I exported a QT Reference movie - the original source is anamorphic wide - the first ref movie I exported was a 4:3 Letterbox (and it plays fine in DVDSP). Th

  • IChat AV no workie on new MacBook

    I just purchased a MacBook so that I could iChat AV w/ greater freedom than my iBook w/ an iSight. Well, it doesn't work. I keep getting error message #8 saying that "[insert my name here] failed to respond" It works on my iBook w/ iSight. I'm also r

  • Creating film rolls does not seem possible?!?

    I am trying to organise my iPhoto library by creating new film rolls but it appears that it will not let me do it. I select the photos that I want in the new film roll and then click <file> but "create new film roll" is still light grey and therefore