Thanks to the estimable @Alexander_Ploetz, I’ve managed a script for exporting a PDF which automatically assigns a fixed location for the export.
I can make a working script for a one-page PDF and another for a two-page PDF, but what I can’t seem to do is make the script work regardless of the number of pages in the layout. If the value doesn’t match the number of pages in the layout, nothing happens.
Any users with knowledge of scripting able to give some input? Thanks!
local app=DoApp.DoApp()
app:doCommand([[Print.PrintWithCurrentSettingsInternal?OpenScoreID=0&PrintingControllerID=0&UseSystemPrint=0]])
app:doCommand([[File.Print?PrintJob=<\?xml version="1.0" encoding="utf-8"\?>
<name/>
<layoutprintrecipe>
<layoutid>0</layoutid>
<numpages>1</numpages>
<pageswithoptions>
<pagerange>
<firstpage_index>1</firstpage_index>
<firstpage_number>1</firstpage_number>
<lastpage_index>1</lastpage_index>
</pagerange>
<printoptions>
<Border>
<value>false</value>
<indeterminate>false</indeterminate>
</Border>
<CollateCopies>
<value>true</value>
<indeterminate>false</indeterminate>
</CollateCopies>
<CropMarks>
<value>false</value>
<indeterminate>false</indeterminate>
</CropMarks>
<CustomScaleFactorPercent>
<value>100</value>
<indeterminate>false</indeterminate>
</CustomScaleFactorPercent>
<DateAndTime>
<value>false</value>
<indeterminate>false</indeterminate>
</DateAndTime>
<Destination>
<value>kGraphics</value>
<indeterminate>false</indeterminate>
</Destination>
<DuplexEdgeLandscape>
<value>kFlipAutomatically</value>
<indeterminate>false</indeterminate>
</DuplexEdgeLandscape>
<DuplexEdgePortrait>
<value>kFlipAutomatically</value>
<indeterminate>false</indeterminate>
</DuplexEdgePortrait>
<DuplexMode>
<value>kSingleSided</value>
<indeterminate>false</indeterminate>
</DuplexMode>
<DuplexReverseOrderOfOutwardPages>
<value>false</value>
<indeterminate>false</indeterminate>
</DuplexReverseOrderOfOutwardPages>
<FinalPageOrientation>
<value>kPortrait</value>
<indeterminate>false</indeterminate>
</FinalPageOrientation>
<FinalPageSize>
<value>Letter</value>
<indeterminate>false</indeterminate>
</FinalPageSize>
<GraphicColours>
<value>kColour</value>
<indeterminate>false</indeterminate>
</GraphicColours>
<GraphicDestinationFolder>
<value>C:/Users/Dan Laptop/Dropbox (Grace Immanuel)/Professional/Hymnworks/Current Hymnworks Projects/1 Master PDFs</value>
<indeterminate>false</indeterminate>
</GraphicDestinationFolder>
<GraphicFormat>
<value>kPDF</value>
<indeterminate>false</indeterminate>
</GraphicFormat>
<GraphicResolution>
<value>150</value>
<indeterminate>false</indeterminate>
</GraphicResolution>
<JobType>
<value>kNormal</value>
<indeterminate>false</indeterminate>
</JobType>
<NumCopies>
<value>1</value>
<indeterminate>false</indeterminate>
</NumCopies>
<NumPages>
<value>1</value>
<indeterminate>false</indeterminate>
</NumPages>
<PageOrientation>
<value>kPortrait</value>
<indeterminate>false</indeterminate>
</PageOrientation>
<PageRange>
<value>kAllPages</value>
<indeterminate>false</indeterminate>
</PageRange>
<PageRanges>
<value>1 - 1</value>
<indeterminate>false</indeterminate>
</PageRanges>
<PageSize>
<value>Letter</value>
<indeterminate>false</indeterminate>
</PageSize>
<PrintFinalPageSeparately>
<value>false</value>
<indeterminate>false</indeterminate>
</PrintFinalPageSeparately>
<PrinterDescription>
<value>Adobe PDF</value>
<indeterminate>false</indeterminate>
</PrinterDescription>
<Scaling>
<value>kFitToPaper</value>
<indeterminate>false</indeterminate>
</Scaling>
<ViewOptions>
<value>false</value>
<indeterminate>false</indeterminate>
</ViewOptions>
<Watermark>
<value>false</value>
<indeterminate>false</indeterminate>
</Watermark>
<WatermarkText>
<value/>
<indeterminate>false</indeterminate>
</WatermarkText>
<defaultgraphicdestinationdirectory>C:\\Users\\Dan Laptop\\Dropbox (Grace Immanuel)\\Professional\\Hymnworks\\Current Hymnworks Projects\\0 Master Dorico files</defaultgraphicdestinationdirectory>
</printoptions>
</pageswithoptions>
</layoutprintrecipe>
&OpenScoreID=0]])