I hereby claim:
- I am nukleas on github.
- I am nader_heidari (https://keybase.io/nader_heidari) on keybase.
- I have a public key ASAV323_M83VymeW0lUXxkV1rxdxIHHXXZ7exBPhgoQh-Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Simple Find-Change with Range | |
function myDisplayDialog() { | |
"use strict"; | |
var findChangeTarget, dialogWindow, diaColRows, targetRangeButtons; | |
dialogWindow = app.dialogs.add({name: "Find/Change"}); | |
diaColRows = dialogWindow.dialogColumns.add().dialogRows.add(); // Just to shorten the line so it reads easier | |
diaColRows.staticTexts.add({staticLabel: "Search Range:"}); | |
targetRangeButtons = diaColRows.radiobuttonGroups.add(); | |
targetRangeButtons.radiobuttonControls.add({staticLabel: "Document", checkedState: true}); | |
targetRangeButtons.radiobuttonControls.add({staticLabel: "Selected Story"}); |
function openFile() { | |
"use strict"; | |
var filePath, open_file; | |
/* | |
Instead of a hard-coded path, I decided to just have a dialog. | |
This is so you don't have to worry about changing the code too much. | |
*/ | |
filePath = File.openDialog("Choose the file containing your find/change list"); | |
if (filePath && filePath.open("r", undefined, undefined)) { | |
open_file = new File(filePath); |
//Instant PDF Export | |
//Written by Nukleas | |
// | |
// | |
myStory = app.activeDocument.name; // Pulls the name of the document | |
myStory = myStory.split(/[\s.]+/); // Trims the stuff after the . or spaces, which is usually junk like [Pr] or .icml | |
app.layoutPDFExportPreferences.viewPDF = true //Force view PDF after export (Galley) | |
app.galleyPDFExportPreferences.viewPDF = true //Force view PDF after export (Galley) | |
myTypeNumber=app.documents.item(0).windows.item(0).viewTab; //This checks which view tab (Galley, Story, Layout) and sets that value to myTypeNumber | |
if(myTypeNumber==1699504505){// If it's layout, (The data comes in as a number. It's somewhere in the Help...Object Model Viewer, and don't ask me how they decided that.) then |