r36058804bwut
Participant
r36058804bwut
Participant
Activity
‎Feb 21, 2025
06:26 AM
Hello, I have a folder with 100 txt files ( unicode text ) and an Indesign file ( .indd file ) I need to: 1. open Indesign file 2. get all txt files in folder to indesign 3. merge them and record all text files 4. save indesign files with the text files names as indd and pdf in a folder Is that possible to do? Thank you
... View more
‎Oct 06, 2024
04:18 AM
I already use this script , my problem is that the Multi-Page importer script allows pages range when placing indesign file , I want the script to allow also page range for pdf files not indesign files only
... View more
‎Oct 05, 2024
09:03 AM
Any help here !!!!!!!!!!!!!!
... View more
‎Oct 05, 2024
07:06 AM
Any help here !!!
... View more
‎Oct 05, 2024
04:23 AM
Hi All
I want an indesign script that places pdf , indesign files pages in indeign
I found a script called multipdf page importer but it only places indesign files with page range
I want pdf files also with page range
thanks
<Title renamed by MOD>
... View more
‎Oct 05, 2024
04:18 AM
Any help here ????????????????????????????
... View more
‎Aug 27, 2024
09:06 AM
I am very grateful . Thank you very very much ----------------------------- Can you see a private messages please
... View more
‎Aug 27, 2024
09:01 AM
Hi -------------------- I tried with chat gpt to make an option to select all pages at once but must write the total number of pdf file pages and select all pages -------------------------- function main() { // Suppress alert dialogs app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT; try { // Create a dialog var dialog = new Window("dialog", "Place PDF or InDesign Pages"); // Add a panel for file selection var filePanel = dialog.add("panel", undefined, "Select PDF or InDesign File"); filePanel.orientation = "row"; // Add a button to select the file var selectFileBtn = filePanel.add("button", undefined, "Select File"); // Add a static text to display the selected file path var filePathText = filePanel.add("statictext", undefined, "No file selected"); filePathText.size = [300, 20]; // Add a panel for page range input var rangePanel = dialog.add("panel", undefined, "Page Range (e.g., 1-5, 7, 9-10)"); rangePanel.orientation = "row"; // Add a checkbox to select all pages var selectAllCheckbox = rangePanel.add("checkbox", undefined, "Select All Pages"); // Add a text input for custom page ranges var rangeInput = rangePanel.add("edittext", undefined, ""); rangeInput.size = [200, 20]; rangeInput.enabled = false; // Disable initially // Enable/Disable range input based on checkbox state selectAllCheckbox.onClick = function () { rangeInput.enabled = !selectAllCheckbox.value; }; // Add a panel to input total pages (only visible for PDFs) var totalPagesPanel = dialog.add("panel", undefined, "Total Pages in PDF"); var totalPagesInput = totalPagesPanel.add("edittext", undefined, ""); totalPagesInput.size = [50, 20]; totalPagesPanel.visible = false; // Initially hidden // Add an OK and Cancel button dialog.add("button", undefined, "OK"); dialog.add("button", undefined, "Cancel"); // Handle the file selection button click selectFileBtn.onClick = function () { var file = File.openDialog("Select a PDF or InDesign file", "*.pdf;*.indd", false); if (file) { filePathText.text = file.fsName; var fileType = file.name.split('.').pop().toLowerCase(); totalPagesPanel.visible = (fileType === "pdf"); } }; // Show the dialog and get the result if (dialog.show() != 1) return; // Get the selected file path var filePath = filePathText.text; if (filePath == "No file selected") return; var file = new File(filePath); var fileType = file.name.split('.').pop().toLowerCase(); var doc = app.documents.add(); // Create a new document with default settings var docPreferences = doc.documentPreferences; docPreferences.facingPages = false; var totalPages; if (fileType === "pdf") { totalPages = parseInt(totalPagesInput.text); if (isNaN(totalPages) || totalPages <= 0) { alert("Please enter a valid number of total pages."); return; } } else if (fileType === "indd") { var inddDocument = app.open(file, false); totalPages = inddDocument.pages.length; inddDocument.close(SaveOptions.NO); } // Parse the page range var pagesToPlace; if (selectAllCheckbox.value) { pagesToPlace = []; for (var i = 0; i < totalPages; i++) { pagesToPlace.push(i + 1); } } else { pagesToPlace = parsePageRange(rangeInput.text); if (!pagesToPlace.length) { alert("Invalid page range."); return; } } // Handle the first page separately var firstPage = doc.pages[0]; firstPage.marginPreferences.properties = { top: 0, bottom: 0, left: 0, right: 0 }; if (fileType === "pdf") { placePDF(file, pagesToPlace, doc, firstPage); } else if (fileType === "indd") { placeINDD(file, pagesToPlace, doc); } else { alert("Unsupported file type."); return; } // Clear and reset the first page content firstPage = doc.pages[0]; firstPage.pageItems.everyItem().remove(); placeContentOnPage(file, 0, doc, firstPage, fileType); } catch (e) { alert("An error occurred: " + e.message); } finally { app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL; } } // Function to place content on a page function placeContentOnPage(file, pageNumber, doc, page, fileType) { if (fileType === "pdf") { var pdfPlaceOptions = app.pdfPlacePreferences; pdfPlaceOptions.pageNumber = pageNumber + 1; var pdfPage = page.place(file)[0]; var pdfBounds = pdfPage.geometricBounds; var pdfWidth = pdfBounds[3] - pdfBounds[1]; var pdfHeight = pdfBounds[2] - pdfBounds[0]; doc.documentPreferences.pageWidth = pdfWidth; doc.documentPreferences.pageHeight = pdfHeight; pdfPage.geometricBounds = [0, 0, pdfHeight, pdfWidth]; pdfPage.fit(FitOptions.FRAME_TO_CONTENT); } else if (fileType === "indd") { var inddDocument = app.open(file, false); // Open the InDesign file without showing the document var inddPage = inddDocument.pages[pageNumber]; inddPage.pageItems.everyItem().duplicate(page); var inddBounds = page.pageItems[0].geometricBounds; var inddWidth = inddBounds[3] - inddBounds[1]; var inddHeight = inddBounds[2] - inddBounds[0]; doc.documentPreferences.pageWidth = inddWidth; doc.documentPreferences.pageHeight = inddHeight; page.pageItems.everyItem().geometricBounds = [0, 0, inddHeight, inddWidth]; page.pageItems.everyItem().fit(FitOptions.FRAME_TO_CONTENT); inddDocument.close(SaveOptions.NO); // Close the InDesign document without saving } } // Function to place PDF pages function placePDF(pdfFile, pagesToPlace, doc, firstPage) { for (var i = 0; i < pagesToPlace.length; i++) { var page = i === 0 ? firstPage : doc.pages.add(); placeContentOnPage(pdfFile, pagesToPlace[i] - 1, doc, page, "pdf"); } } // Function to place InDesign pages function placeINDD(inddFile, pagesToPlace, doc) { var inddDocument = app.open(inddFile, false); for (var i = 0; i < pagesToPlace.length; i++) { var page = i === 0 ? doc.pages[0] : doc.pages.add(); placeContentOnPage(inddFile, pagesToPlace[i] - 1, doc, page, "indd"); } inddDocument.close(SaveOptions.NO); } // Function to parse the page range input function parsePageRange(rangeStr) { var pages = []; var ranges = rangeStr.split(/,\s*/); for (var i = 0; i < ranges.length; i++) { var range = ranges[i].split("-"); if (range.length == 1) { pages.push(parseInt(range[0])); } else if (range.length == 2) { var start = parseInt(range[0]); var end = parseInt(range[1]); for (var j = start; j <= end; j++) { pages.push(j); } } } return pages; } // Execute the main function app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Place PDF or InDesign Pages"); -------------------------------- please , If anyone can remove box to write the total number of pages , I'll be thank him thanks
... View more
‎Aug 27, 2024
08:39 AM
Great thanks for you The script works like as charm Please can you tell me what should I change if I want to to place 2 pages from the second file between every 2 pages in the first file or 3 pages ........ etc Thanks
... View more
‎Aug 27, 2024
07:52 AM
I tried to make as you said but this errors appeared
... View more
‎Aug 27, 2024
06:23 AM
Any help
... View more
‎Aug 27, 2024
05:26 AM
Hi All I have 2 pdf files , 1 and 2 .... each of them have 20 pages , the 20 pages of the second file are the same page ( duplicate ) , Is there a script or autoamtic method to place any page from the second pdf ( duplicated ) file between each pages of the first file ? Thanks
... View more
‎Aug 27, 2024
02:47 AM
yes , that's excatly I mean
... View more
‎Aug 27, 2024
12:19 AM
Hi laubender Thanks for your help , but the script you attached doesn't contain page range
... View more
‎Aug 26, 2024
10:55 AM
Sorry , I am a begiiner , I created this script with chat gpt , if you can add ( select all pages ) do it Thanks
... View more
‎Aug 24, 2024
04:21 AM
problem solved by this script ---------------------------------------------------- function main() { // Suppress alert dialogs app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT; try { // Create a dialog var dialog = new Window("dialog", "Place PDF or InDesign Pages"); // Add a panel for file selection var filePanel = dialog.add("panel", undefined, "Select PDF or InDesign File"); filePanel.orientation = "row"; // Add a button to select the file var selectFileBtn = filePanel.add("button", undefined, "Select File"); // Add a static text to display the selected file path var filePathText = filePanel.add("statictext", undefined, "No file selected"); filePathText.size = [300, 20]; // Add a panel for page range input var rangePanel = dialog.add("panel", undefined, "Page Range (e.g., 1-5, 7, 9-10)"); var rangeInput = rangePanel.add("edittext", undefined, ""); rangeInput.size = [300, 20]; // Add an OK and Cancel button dialog.add("button", undefined, "OK"); dialog.add("button", undefined, "Cancel"); // Handle the file selection button click selectFileBtn.onClick = function () { var file = File.openDialog("Select a PDF or InDesign file", "*.pdf;*.indd", false); if (file) { filePathText.text = file.fsName; } }; // Show the dialog and get the result if (dialog.show() != 1) return; // Get the selected file path var filePath = filePathText.text; if (filePath == "No file selected") return; // Parse the page range var pagesToPlace = parsePageRange(rangeInput.text); if (!pagesToPlace.length) { alert("Invalid page range."); return; } var file = new File(filePath); var fileType = file.name.split('.').pop().toLowerCase(); var doc = app.documents.add(); // Create a new document with default settings var docPreferences = doc.documentPreferences; docPreferences.facingPages = false; // Handle the first page separately var firstPage = doc.pages[0]; firstPage.marginPreferences.properties = { top: 0, bottom: 0, left: 0, right: 0 }; if (fileType === "pdf") { placePDF(file, pagesToPlace, doc, firstPage); } else if (fileType === "indd") { placeINDD(file, pagesToPlace, doc); } else { alert("Unsupported file type."); return; } // Clear and reset the first page content firstPage = doc.pages[0]; firstPage.pageItems.everyItem().remove(); placeContentOnPage(file, 0, doc, firstPage, fileType); } catch (e) { alert("An error occurred: " + e.message); } finally { app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL; } } // Function to place content on a page function placeContentOnPage(file, pageNumber, doc, page, fileType) { if (fileType === "pdf") { var pdfPlaceOptions = app.pdfPlacePreferences; pdfPlaceOptions.pageNumber = pageNumber + 1; var pdfPage = page.place(file)[0]; var pdfBounds = pdfPage.geometricBounds; var pdfWidth = pdfBounds[3] - pdfBounds[1]; var pdfHeight = pdfBounds[2] - pdfBounds[0]; doc.documentPreferences.pageWidth = pdfWidth; doc.documentPreferences.pageHeight = pdfHeight; pdfPage.geometricBounds = [0, 0, pdfHeight, pdfWidth]; pdfPage.fit(FitOptions.FRAME_TO_CONTENT); } else if (fileType === "indd") { var inddDocument = app.open(file, false); // Open the InDesign file without showing the document var inddPage = inddDocument.pages[pageNumber]; inddPage.pageItems.everyItem().duplicate(page); var inddBounds = page.pageItems[0].geometricBounds; var inddWidth = inddBounds[3] - inddBounds[1]; var inddHeight = inddBounds[2] - inddBounds[0]; doc.documentPreferences.pageWidth = inddWidth; doc.documentPreferences.pageHeight = inddHeight; page.pageItems.everyItem().geometricBounds = [0, 0, inddHeight, inddWidth]; page.pageItems.everyItem().fit(FitOptions.FRAME_TO_CONTENT); inddDocument.close(SaveOptions.NO); // Close the InDesign document without saving } } // Function to place PDF pages function placePDF(pdfFile, pagesToPlace, doc, firstPage) { for (var i = 0; i < pagesToPlace.length; i++) { var page = i === 0 ? firstPage : doc.pages.add(); placeContentOnPage(pdfFile, pagesToPlace[i] - 1, doc, page, "pdf"); } } // Function to place InDesign pages function placeINDD(inddFile, pagesToPlace, doc) { for (var i = 0; i < pagesToPlace.length; i++) { var page = i === 0 ? doc.pages[0] : doc.pages.add(); placeContentOnPage(inddFile, pagesToPlace[i] - 1, doc, page, "indd"); } } // Function to parse the page range input function parsePageRange(rangeStr) { var pages = []; var ranges = rangeStr.split(/,\s*/); for (var i = 0; i < ranges.length; i++) { var range = ranges[i].split("-"); if (range.length == 1) { pages.push(parseInt(range[0])); } else if (range.length == 2) { var start = parseInt(range[0]); var end = parseInt(range[1]); for (var j = start; j <= end; j++) { pages.push(j); } } } return pages; } // Execute the main function app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Place PDF or InDesign Pages");
... View more
‎Aug 24, 2024
03:22 AM
That is my problem also , I tried to fix it but failed Can you try to fix it ? the first page appears outside indesign page ( above ) and I should make its fitting ( frame proportionlly ) to apear look at the screenshot
... View more
‎Aug 24, 2024
02:01 AM
really 😞
... View more
‎Aug 24, 2024
01:51 AM
Any help here to chech the above code that make the first page is blank
... View more
‎Aug 24, 2024
01:51 AM
1 Upvote
that's because we have indesign installed with another language It works on english version only 😞
... View more
‎Aug 23, 2024
01:43 PM
1 Upvote
Any help here
... View more
‎Aug 23, 2024
12:21 PM
1 Upvote
I'm sorry I want page range multipdf script included in indesign start with page 1 only there is no page range
... View more
‎Aug 23, 2024
09:15 AM
multipage pdf included in indesign place pdf pages in indesign default page size ( A4 ) This script place pdf pages with their orginal size
... View more
‎Aug 23, 2024
08:12 AM
Any help Here !!!!
... View more
‎Aug 23, 2024
07:28 AM
Hi Iam beginner in indesign and wanted a script that place pdf pages with page range into indesign file with pdf page size . I already reached to a script by asking chat gpt but ( the problem is that the first page is empty ) Can you fix this problem please here is the code --------------------------------------------- #target indesign function main() { // Suppress alert dialogs app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT; try { // Create a dialog var dialog = new Window("dialog", "Place PDF Pages"); // Add a panel for PDF selection var pdfPanel = dialog.add("panel", undefined, "Select PDF"); pdfPanel.orientation = "row"; // Add a button to select the PDF var selectPDFBtn = pdfPanel.add("button", undefined, "Select PDF"); // Add a static text to display the selected PDF path var pdfPathText = pdfPanel.add("statictext", undefined, "No file selected"); pdfPathText.size = [300, 20]; // Add a panel for page range input var rangePanel = dialog.add("panel", undefined, "Page Range (e.g., 1-5, 7, 9-10)"); var rangeInput = rangePanel.add("edittext", undefined, ""); rangeInput.size = [300, 20]; // Add an OK and Cancel button dialog.add("button", undefined, "OK"); dialog.add("button", undefined, "Cancel"); // Handle the PDF selection button click selectPDFBtn.onClick = function () { var pdfFile = File.openDialog("Select a PDF file"); if (pdfFile) { pdfPathText.text = pdfFile.fsName; } }; // Show the dialog and get the result if (dialog.show() != 1) return; // Get the selected PDF file path var pdfFilePath = pdfPathText.text; if (pdfFilePath == "No file selected") return; // Parse the page range var pagesToPlace = parsePageRange(rangeInput.text); if (!pagesToPlace.length) { alert("Invalid page range."); return; } var pdfFile = new File(pdfFilePath); var pdfPlaceOptions = app.pdfPlacePreferences; var doc = app.documents.add(); // Create a new document // Use the first page of the document for the first PDF page var firstPage = doc.pages[0]; pdfPlaceOptions.pageNumber = pagesToPlace[0]; // Place the first PDF page on the first InDesign page var pdfPage = firstPage.place(pdfFile)[0]; // Get the dimensions of the placed PDF var pdfBounds = pdfPage.geometricBounds; var pdfWidth = pdfBounds[3] - pdfBounds[1]; var pdfHeight = pdfBounds[2] - pdfBounds[0]; // Adjust the document page size to match the PDF page size doc.documentPreferences.pageWidth = pdfWidth; doc.documentPreferences.pageHeight = pdfHeight; // Ensure there are no margin issues firstPage.marginPreferences.properties = { top: 0, bottom: 0, left: 0, right: 0 }; // Center the placed PDF on the page pdfPage.fit(FitOptions.FRAME_TO_CONTENT); pdfPage.move([0, 0]); // Loop through the remaining pages, placing them one by one for (var i = 1; i < pagesToPlace.length; i++) { try { var pageNumber = pagesToPlace[i]; pdfPlaceOptions.pageNumber = pageNumber; // Add a new page for each remaining PDF page var newPage = doc.pages.add(); // Place the PDF page on the new InDesign page pdfPage = newPage.place(pdfFile)[0]; // Get the dimensions of the placed PDF pdfBounds = pdfPage.geometricBounds; pdfWidth = pdfBounds[3] - pdfBounds[1]; pdfHeight = pdfBounds[2] - pdfBounds[0]; // Adjust the document page size to match the PDF page size doc.documentPreferences.pageWidth = pdfWidth; doc.documentPreferences.pageHeight = pdfHeight; // Ensure there are no margin issues newPage.marginPreferences.properties = { top: 0, bottom: 0, left: 0, right: 0 }; // Center the placed PDF on the page pdfPage.fit(FitOptions.FRAME_TO_CONTENT); pdfPage.move([0, 0]); } catch (e) { alert("Error placing page number " + pageNumber + ": " + e.message); } } } catch (e) { alert("An error occurred: " + e.message); } finally { // Restore the original user interaction level app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL; } } // Function to parse the page range input function parsePageRange(rangeStr) { var pages = []; var ranges = rangeStr.split(/,\s*/); for (var i = 0; i < ranges.length; i++) { var range = ranges[i].split("-"); if (range.length == 1) { pages.push(parseInt(range[0])); } else if (range.length == 2) { var start = parseInt(range[0]); var end = parseInt(range[1]); for (var j = start; j <= end; j++) { pages.push(j); } } } return pages; } // Execute the main function app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Place Multiple PDF Pages"); ------------------------------- Thanks
... View more
‎Aug 23, 2024
04:33 AM
I have one file only not other files , I don't want select page by page and place images manually I want script that make placing easier because my file have 400 pages
... View more
‎Aug 23, 2024
04:19 AM
I don't want to select pages manually because each time i relink , a box apear to let me choose the image that i want to replace
... View more
‎Aug 23, 2024
04:05 AM
2 Upvotes
I reached to this code by chat GPT , works as a charm ---------------------------------------------------------------------------------- var doc = app.activeDocument; // Create the main dialog var dialog = app.dialogs.add({name: "Replace Images on Selected Pages"}); var result = dialog.dialogColumns.add().staticTexts.add({ staticLabel: "Enter page numbers (comma-separated) and click OK to select the image." }); // Add a text field to input page numbers var pageNumbersField = dialog.dialogColumns.add().textEditboxes.add({ editContents: "", minWidth: 200, staticLabel: "Page Numbers:" }); // Show the dialog and capture the result if (dialog.show() == true) { // Get the entered page numbers var pageNumbers = pageNumbersField.editContents; // Prompt the user to select the image file var imageFile = File.openDialog("Select the image to replace with"); if (pageNumbers && imageFile) { var pages = pageNumbers.split(','); for (var i = 0; i < pages.length; i++) { var pageNumber = parseInt(pages[i], 10) - 1; // Convert to zero-based index if (pageNumber >= 0 && pageNumber < doc.pages.length) { var page = doc.pages[pageNumber]; // Remove all existing images on the page before placing the new one var images = page.allGraphics; for (var j = images.length - 1; j >= 0; j--) { images[j].remove(); } // Place the new image on the page var newImage = page.place(imageFile)[0]; newImage.fit(FitOptions.PROPORTIONALLY); // Adjust the image fitting as necessary } else { alert("Page number " + (pageNumber + 1) + " is out of range."); } } } else { alert("Please enter valid page numbers and select an image."); } } else { dialog.destroy(); alert("Action cancelled."); }
... View more
‎Aug 23, 2024
04:03 AM
Thanks for your effort I will see , contact you when I need Thanks
... View more
‎Aug 23, 2024
03:31 AM
Iam working on pc , but i want to know how much is the full version ?
... View more