Create the folder in the categories

Hi all

I asked to create a Package for Indesign according to the Version folder Structure.

But the condition is.

If the path with the Version_3 folder, then the package is posted at this location only.  First choice

or

If the path with the Version_2 folder, then the package is posted at this location only.  Second choice

or

If the path with Version_1 folder, then the package is posted in this location alone //Third preference

Try the Code:

var myDoc = app.activeDocument;
var myFilePath = myDoc.filePath + "";
var myOutput_Name = myDoc.name.replace(/\.indd/gi, "")


var myFinalPath = myFilePath.replace(/DOCUMENT/i, "CLIENT_ORIGINAL")


var test3 = myFinalPath + "/VERSION_3";
var test2 = myFinalPath + "/VERSION_2";
var test1 = myFinalPath + "/VERSION_1";


//-------------------------Help Needed Here only-----------------------------------
if(Folder(test3.exists) != null){
        var to = new File(test2 + "/" + myOutput_Name);
    }


else if(Folder(test2.exists) != null){
        var to = new File(test1 + "/" + myOutput_Name);
    }
else if(Folder(test1.exists) != null){
        var to = new File(test1 + "/" + myOutput_Name);
    }
//-------------------------Help Needed Here only-----------------------------------


alert(to)
var myOutput_Folder = Folder(to).create()
//~ if(myOutput_Folder.exists == true)
//~ {
//~     myOutput_Folder.remove();
//~     myOutput_Folder.create();
//~     }


//------------------Package Concept is started here-----------------
app.activeDocument.packageForPrint (
        to,
        copyingFonts = true, 
        copyingLinkedGraphics = true,
        copyingProfiles = false,
        updatingGraphics = true,
        includingHiddenLayers = true,
        ignorePreflightErrors = true,
        creatingReport = false,
        versionComments = "comment",
        forceSave = true,
         );

Thanks in advance

Siraj

Hello

You can try this,

{if ((test3) Folder. Exists)}

var to = new file (test3 + "/" + myOutput_Name);

}

else {if (Folder (test2) .exists)

var to = new file (test2 + "/" + myOutput_Name);

}

else {if (Folder (test1) .exists)

var to = new file (test1 + "/" + myOutput_Name);

}

Tags: InDesign

Similar Questions

  • SkyDrive, I created a folder, the names of 'recipes', I want to drop this file into categories for different types of food.

    If I create a folder called 'recipes' is it possible to create a path to break the categories, e.g., beef, pork, etc.

    SkyDrive, I created a folder name "recipes", that I want to drop this file into categories for different types of food, i.e. beef, pork, biscuits, pies, etc.  Is this possible?

    You can get help with Windows Live here services: http://windowslivehelp.com/forums.aspx?productid=6

  • I'm trying to map a network drive. I created the target folder on the shared computer, but the folder does not appear when I try to map?

    I have a network machine, 4 machines and a fifth small office which acts as a server.  I created a folder target on the server.  Then, I try to map a drive on one of the four other machines that have access to this folder target on the server.  However, the target folder will not appear when I go to the other machine card.

    Hey Dano,

    Your question is more complex that most seem to be on the answers. I suggest that you re-post on our TechNetforums where computer professionals can help you.

    http://social.technet.Microsoft.com/forums/en-us/categories/

    I hope this helps.

  • Why "save under" create a folder separated for images when the page is saved.

    for example, when you save the ezpass document he used to save the page. now, it saves the page more creates a folder that contains images. I can't delete the folder without leaving the page. My mistake, it would be using Firefox.

    now in support of Firefox.

    But to answer your question, HTML is a markup language that displays images files etc. Unlike a document of treatment of all the elements of the document included in a single file. HTML stores the items of the page as individual items. If a folder is created to hold these items such as images, files audio video flash etc..

    Microsoft encouraged a MHTML file format they have invented and placed in Internet explorer, which is a single file of storage, but it is really only supported in Internet Explorer.

    It seem not to be modules on the site of the add-on to enable MHTML in firefox such as

    https://addons.Mozilla.org/firefox/addon/Mozilla-archive-format/?src=search

    https://addons.Mozilla.org/firefox/addon/UnMHT/?src=search

    If you have had this feature before, perhaps you have already installed an add-on?

  • Creating the new folder to external hard drive

    I've searched the forums and found many discussions on this, but I'm in a quandary.  I have an external hard drive Seagate 4 TB with about 2 TB of data backed up to it.  I was obviously saving data on this external drive without any problems.

    Today, I tried to move my MacBookPro some data on the external drive and was unable to create a folder.  Reading the forums, I checked my permissions and it shows now that I have "Read only" permissions  In addition, it displays the disk formatted in NTFS.

    How is that possible?  Everything was going well, 8 weeks ago.  How can I fix?

    Reformat the drive for use on a Mac, NTFS for Windows machines, the drive to Mac OS extended (journaled) format

  • How to create the new folder message

    How do I / I think that this question would appear in the list of common questions

    Can not find a question drop down that says "create a folder" etc.

    Try the 'file' - then 'new' - menu 'new subfolder '.

  • Firefox creates "desktop" folder on the desktop whenever I have download

    So I just installed Firefox on my new laptop, and whenever I download something, Firefox creates a "Desktop" folder on the desktop and download of the sticks in there. I used to be able to download directly on the desktop, but with this version, I can't. I tried tools > Options > save files to, but whenever I have click on the Browse button and select the location of my desired download (office under the "Favorites" section), Firefox ignores and sets the path as C:\Users\User1\Desktop\Desktop. Is it possible to fix this? It is extremely irritating.

    See if it works for you as it does for me.

    1. Create a new folder on the desktop labeled downloads (or any other name),
    2. Open tools > Options-> general
    3. Downloads, click on the Browse button and select the new downloads folder that you just created.

    Firefox wants a "folder name" for downloads, by specifying the 'bureau' only or won't 'Favorites '. When you try to force the issue, the name of the folder will mimic what the user is trying to specify. In your case, it created the folder "Desktop" on the desktop. Yes, it's different from previous versions of Firefox, but this change took place ago - many versions so it is not really 'new' any longer.

  • Created the folder in the bookmarks bar, but can't drag thumbnails of bookmark in it. Difficulty?

    I created a folder in toolbar of bookmarks ('A') in the same browsing session in which the buggy ('B') record began. I can always drag A bookmark icons, but nothing leaves me place these same icons/tiles in B.

    It's rather frustrating. It follows the situation even if I use the button drop-down bookmarks menu and click, "show all bookmarks" and attempt to drag the icon to bookmark in folder B (in fact, in the window "Show all", it is a circle with a line through it when I try to do.

    Recently, I restored Firefox to its factory State and will do so again if notified. Thank you in advance with my dilemma, even if you do not have a fix. I am just grateful that there is a community of active support.

    Problems with bookmarks and history does not properly can be caused by a corrupted database places.sqlite file.

    You can check for problems with the database places.sqlite file in the Firefox profile folder.

  • AppleScript - creat a folder, subfolders and fill it with the sample image

    Please help me to achieve this goal, no doubt, simple goal.

    I did only a very small amount of applescripting before and always slaughtered other scripts of resources available online but am having hard to identify ways to achieve this.

    I would like to use applescript to automate the creation of a simple folder NewFolder and newSubFolders structure in a destination that the user can choose and the number of subfolders (subCount), selected using the command prompt:


    subCount value to text returned of (display dialog "how subfolders?" by default of answer 85)

    The NewFolder will always be in a format of date backwards for example 160202 for 2 February 2016.

    The sub folder names end with 3 numeric characters, leading 0s to whole number less than 100:

    160202_001, 160202_002, 160202_003 etc etc.

    With all these responses need the user to select an image file and duplicated it or should that be copied to all of the subfolders created by this script.

    All I got so far is to create a script that creates the folder with subfolders structure, but does not work how do the names of the end of records with 3 numeric characters or find out how copy/duplicate a file for each subfolder created by the script.

    Here's my starting point:

    the value JobName to text returned of (display dialog "Please enter Date reference:" default of '160411' response)

    loc to choose a folder with guest "choose the Parent folder location:

    say application 'Finder '.

    targetFolder value to create a new folder in loc with properties {name: JobName}

    end say

    Repeat

    subCount value to text returned of (display dialog "how subfolders?" by default of answer 85)

    Try

    If subCount ≠ "" then

    whole subCount

    output Repeat

    end if

    end try

    end Repeat

    Repeat with I have from 1 to subCount

    display the dialog box "my variable:"& I ".

    say application "Finder" to create a new folder to targetFolder with properties {name: JobName & "_" & I}

    end Repeat

    filetoCopy to Choose file with prompt "choose the image file to be copied."

    display the dialog box "my variable:" & filetoCopy ".

    It does not really matter I order in which the script should occur, i.e. the image file to be copied can be selected first before the creation of the all the subfolders etc... as long as the end result is the same structure.

    I had a look by adding leading 0s to a name of folder but don't really understand how I could do within the repetition that exists in my script.

    Any help much appreciated.

    Mike

    Although this still needs a lot of storage (including the addition of error checking) I managed to get working folders creating and copying a file to the set of folders.

    I'd appreciate it again any help in renaming with 000 leader after the _in, folder names.

    Here's where I'm up to:

    the value JobName to text returned of (display dialog "Please enter Date reference:" default of '160411' response)

    loc to choose a folder with guest "choose the Parent folder location:

    say application 'Finder '.

    targetFolder value to create a new folder in loc with properties {name: JobName}

    end say

    Repeat

    subCount value to text returned of (display dialog "how subfolders?" by default of answer 85)

    Try

    If subCount ≠ "" then

    whole subCount

    output Repeat

    end if

    end try

    end Repeat

    Repeat with I have from 1 to subCount

    say application "Finder" to create a new folder to targetFolder with properties {name: JobName & "_" & I}

    end Repeat

    say application 'Finder '.

    _destination to choose a folder with guest from "choose the main folder created above:

    filetoCopy to Choose file with guest "choose image file copy:

    display the dialog box "my variable:" & filetoCopy ".

    the value _listOfDest to (each of _destination folder ) as alias list

    Repeat with CurrentNumber from 1 to (count _listOfDest)

    duplicate filetoCopy file to the file (article of _listOfDest CurrentNumber)

    end Repeat

    end say



  • Hello. I created a folder music on my external hard drive connected to my asus router.  I can now access the music through my media library.  How can I change the folder when I make new purchases to iTunes easily without doing it one by one

    I created a folder music on an external hard drive connected to my asus router.  I copied my music from my iTunes library in this folder access and can now my kodi media network.  How I updated the folder when I do new iTunes purchase without having to do it one by one thanks

    You can use a backup tool that updates only modified files.  You don't say what kind of computer you use.

    ITunes is actively using media on the external hard drive so you can replace it. Simply copy the media to one other player does not have iTunes it use it.  iTunes is probably still using media to your internal drive.

  • says device cannot create the folder

    have been on a cruise and tried to use their computer to download some photos but wouldn't work - now my camera says * cannot create the folder *-my computer can't see also photos even though my computer says there is only 3 GB of space left on a 16 GB of my camera card is an EOS 60 d - my card a San disk Ultra 30 Mb 10 16 GB

    It seems that the SD card is damaged. But it might be possible to recover the files. There are a lot of tips online on how to do it. You could start here... http://www.PCAdvisor.co.UK/how-to/storage/3481659/how-get-files-off-corrupt-SD-card/

    Good luck, I know how much vacation photos can mean.

  • Cannot create the folder on the storage device

    My flash player works well, but lately, I can't create a folder: it simply indicates: cannot create the folder?

    My flash player works well, but lately, I can't create a folder: it simply indicates: cannot create the folder?

    =====================================
    The dialog box you received usually indicates that there
    are too many files copied to the root directory of the
    flash drive.

    The solution is to remove one or more pictures and
    create new empty folders in their place... then move
    all the photos in the files... problem solved.

  • I can't see changes in a folder unless I go up a level and then re-enter folder, for example, create new folder, rename the folder, rotate the image etc. Can someone please?

    I do not see changes within a folder, except if I go up a level and then again enter the folder, for example, create new folder, rename the folder, rotate the image, etc..

    By pressing the "F5" key would probably be to refresh the folder.

    See if this article helps you with this problem:

    "List of the files in the Windows Explorer folder is not refreshed after that you create, move, or delete files"
      <>http://support.Microsoft.com/kb/823291 >

    HTH,
    JW

  • Error message: cannot create the folder C:\Documents and Settings\Marlon\Local Application BVRP Software\NetWaiting\MoHlog.txt Settings\

    I recently had a problem with the virus 'Restore Windows'. I was able to get rid of it with Malwarebytes antivirus scanner, but when I turn on my computer I get this error message.
    Cannot create the folder C:\Documents and Settings\ of Settings\Marlon\Local Application BVRP Software\NetWaiting\MoHlog.txt

    I'm no expert, but I feel that my C drive disappeared, or at least has been hidden. My documents, pictures and music files are all empty. My programs (start > all programs) have been removed and deleted the shortcuts on the desktop. When I go to my computer, my personal and shared document files are not accessible. Under the description it says that they are hidden. My local disk (c) is also empty, but there is still very little space which suggests that programs and files have not been deleted.
    Is it possible to recover my files?
    Thank you

    Hello

    MoHlog.txt file is related to the software of modem on the computer, you can uninstall and reinsta it check if it works.

    Also scan your computer for any infection by virus still present on the computer using any scanner online.

    You can also try the system restore to the point before that the computer has been infected by the virus and check if it helps.

    Good luck!

  • Create the folder Date current Wise via .bat file

    I want to create a folder using the current date in the .bat file, and then copy some files into the newly created folder. And then copy this folder from one place to the other. that is on the network location. I need that .bat file will work with two Windows XP & Windows 7.

    I'm totally unexperience in the script.

    Hello

    Your Windows XP question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the public to theTechnet on the Technet forums. Here is the link.
    http://social.technet.Microsoft.com/forums/en-us/iTCG/threads

    I hope this helps.

  • Error 1317 on mini 110-3530 can\ ' t create the office installation folder. No way.

    Windows of HP mini 110-3530nr 7

    layout Error 1317 when installing Office 2010. Apparently the path does not exist.

    Thank you

    Bill

    Hello

    This is due to access rights. Please check the answer from following link:

    http://answers.Microsoft.com/en-us/Office/Forum/Office_2007-office_install/error-1317setup-cannot-create-the-folder-during/9063e10c-22E1-4e7c-AB14-6e45a2b514e6

    Kind regards.

Maybe you are looking for

  • What are the channels of meter on SMU-6361 pinout diagram

    Hello I've defined three channels of counters to help assistant DAQ for the SMU-6361 (ctr0, ctr1, ctr2) jury. I don't see any explicit labels on the pinout for the SMU-6361 card diagram indicating where are these counters. Can someone tell me what ar

  • Search and replace, unadulterated second character?

    I'm doing a VI that communicates with an external device via a protocol consisting of images. I made a couple of subVIs that put these images together as hexadecimal strings which are then converted into numbers and passed to the device. The protocol

  • After flashing my Bios on Pavilion DM4t-1100 CTO, I can no more enter the BIOS setup

    After flashing my Bios on Pavilion DM4t-1100 CTO, I can no more enter into the BIOS setup (via the ESC key).  I installed the BIOS twice and the computer always ignores the ESC key and launches Windows 7.  Any ideas?

  • Need to analyze the data $LogFile folder in NTFS fs

    HelloI need to know how to keep track of a deleted file data (more than 4 GB in size) in an NTFS partition.In NTFS file system a file attributes and its chain of clusters of data found in the MFT. If this file is greater than 4 GB in size, and I'm de

  • M125rnw: HP M125rnw sleep mode problem

    Hello Sorry for my English. I recently bought a MFP HP LaserJet Pro M125rnw. I installed the printer using the ethernet connection. I can't solve the problem with the standby printer. After a long stay in the mode 'sleep', the printer refused to prin