[CS3] [JS] Export PDF to the same folder as the InDesign file
Hi,
I have written a JavaScript to export an InDesign file to a PDF file.
The exporting works fine when exporting to a specific folder, but I want the script to export the PDF to the SAME folder as the InDesign file.
For example, if the Indesign file is in a folder called "Owner's Manuals", I want the script to save the PDF into the same "Owner's Manuals" folder.
At the moment I have:
var myFolder = Folder.selectDialog ('Choose a Folder');
but this dialog defaults to the Desktop every time, forcing me to click 6-7 times to locate the relevant folder where I want the PDF to be saved, which is a waste of time.
I want the script to do something like the following:
"Find out the location of this InDesign file, and export the PDF to the same folder"
I have searched this forum, as well as the Scripting Reference, but without any luck.
Any suggestions are greatly appreciated.
Thanks.
Hi
Please another another one time check it out..
//Do not open the PDF Export dialog box. Set "false" to "true" if you want the dialog box.
myDoc.exportFile(ExportFormat.pdfType, myFile, false, "Press Quality");
Instead I used
var ExPDFs= File(Final+myBaseName + ".pdf");
pdfPreset = app.pdfExportPresets.item("Sample");
myDoc.exportFile(ExportFormat.pdfType, ExPDFs, false, pdfPreset);
Here I think u made mistake in "pdfPreset " passing argument...
I used Sample -> PDF Preset name, but u passing PDF Preset is directly [Press Quality]... thats all.
Then how come u say this script is not working....like that?.
I used this script in my Projects U know?.
Please try to reveal and check throughly after that U say the word "Thanks for your suggestion, but it did not work."
OK.
Similar Messages
-
Hay all :-)
Had a quick search and couldn't find an answer to this so asking the question :-)
It looks like i'm going to have to use Premier Pro to convert all my R3D files to mov because *Another Piece of Software ;-)* just doesn't recognise them :-/
I know i can import the R3D files into Premier and then export then as mov which is fine but the problem is in the export window theres no option to place the exported file into the same folder as the original R3D file, there is only the option of choosing a folder which, doesn't pre-designate itself to be the original files folder for some reason.
I have 100s of R3D files to convert to mov and having to find and choose the correct folder for each of them individually would be an incredible pain.
Thx for any help :-)Wow ... just checked through PrPro myself and queued out to AME, and even went into Prelude to try a transcode. You're right, you have to specify a location, or have one in the preset group ... but it has to be a specific one, there's no option for "original folder".
I'd suggest a wish be placed on this, as there's times I'd want to use it also.
https://www.adobe.com/cfusion/mmform/index.cfm?event=processform&name=wishform
Neil -
some music files do not show up in google play music app library. I did clear cache/data and restarted phone. The music is stored on the SD card. Most of the music in the library is in the same folder on the sd card. I can play the song from file manager, but it still is not in the music library in play music.
Cyndi6858, help is here! We'd be happy to help figure this out. Just to be sure though, the Droid Maxx should not have an SD card. Is this the Droid Razr Maxx? How did you add the music to the device? Are you able to see the files and folders located on the SD card or device when plugged in?
Thanks,
MichelleH_VZW
Follow us on Twitter @VZWSupport -
Hello,
Is it possible to have the file projectname_edge.js in a subfolder? Not in the same folder with projectname.html.
It seems that edge.5.0.1.min.js looks for dependencies only in the same place as the main file of the project. Moving projectname_edge.js to other folder (js, script, etc) causes the animation not to run. Can I store it in different folder? I would like to put it into "Content" or "Scripts" folder on the server.
I am trying to integrate edge animation into ASP.NET MVC application, and I do not have any index.html file. I am inserting the <!--Adobe Edge Runtime--> section into the view (the .cshtml file stored in subfolder). Having the projectname_edge.js in the main server path require to deal with security settings, so I would like to put it in 'Scripts'.
I found the video showing the solution for the older API: http://www.edgedocks.com/content/edge-animate-publish-files-and-js-folder but it is no longer valid with Edge 5.0 API
Any ideas how to achieve this?
Thank you in advance!
EricThank You! This is exactly what I looked for!
Additionaly having runtime projectname_edge.js in htmlroot in ASP.NET MVC website, is slowing down the animation show up. Now (with subfolder) it working fast and fluid
Many, many thanks! -
Here's my current javascript:
#target photoshop
// sets document preferences to inches
app.preferences.rulerUnits = Units.INCHES
// these are our values for the END RESULT width and height (in inches) of our image
var fWidth = 11.73;
var fHeight = 5.97;
var CurrentDLPFile=app.activeDocument
var CurrentDLPFileName= CurrentDLPFile.name
var CurrentDLPFilePath="~/Desktop/fetch"
var f = File.saveDialog('Save Where?','');
// in case we double clicked the file
app.bringToFront();
// resizes the canvas to 11.73 x 5.97 inches
CurrentDLPFile.resizeCanvas(UnitValue(fWidth,"in"),UnitValue(fHeight,"in"));
// flattens all layers
CurrentDLPFile.flatten();
// saves as photoshop file
if (f!=null) CurrentDLPFile.saveAs(f,undefined);
// splits channels
CurrentDLPFile.splitChannels();
// converts active K seperation to bitmap form
var bitsaveoptions = new BitmapConversionOptions()
bitsaveoptions.method = BitmapConversionType.HALFTONESCREEN
bitsaveoptions.angle = 45
bitsaveoptions.frequency = 55
bitsaveoptions.resolution = 300
bitsaveoptions.shape = BitmapHalfToneType.ROUND
app.activeDocument.changeMode(ChangeMode.BITMAP,bitsaveoptions);
// THIS IS WHERE I'M HAVING ISSUES- I want to save the file (which at this point is a bmp), with a suffix of 1 in the same folder; and then close the file.
var doc = app.activeDocument;
var docName = doc.name;
docName = docName.match(/(.*)(\.[^\.]+)/) ? docName = docName.match(/(.*)(\.[^\.]+)/):docName = [docName, docName];
var suffix = '_1';
var saveName = new File(decodeURI(doc.path)+'/'+docName[1]+suffix+'.bmp');
function saveFile(app.activeDocument, saveName);I figured it out, here's for anyone else who is struggling with a similar problem:
var CurrentDLPFile=app.activeDocument
// saves active doc as photoshop file
if (f!=null) CurrentDLPFile.saveAs(f,undefined);
//renames active document to whatever was saved
var CurrentDLPFile = app.activeDocument.name
//assigns the location of the saved psd
var psdPath = activeDocument.path
saveBMP = new BMPSaveOptions();
saveBMP.alphaChannels = false;
saveBMP.depth = BMPDepthType.ONE;
saveBMP.flipRowOrder = false;
saveBMP.rleCompression = false;
saveBMP.osType = OperatingSystem.WINDOWS;
var doc = app.activeDocument;
var Name = doc.name.replace(/\.[^\.]+$/, '');
var Suffix = "1";
var saveFile = File(psdPath + "/" + Name + Suffix + ".bmp");
activeDocument.saveAs(saveFile, saveBMP, true, Extension.LOWERCASE);
activeDocument.close( SaveOptions.DONOTSAVECHANGES ); -
Does an external cnt file need to be in the same folder as the master cnt file?
I'm working in RoboHelp Word and have inserted two external
cnt files into a master cnt file. I've selected the option 'use
full path' as the external help file is installed under a different
folder than the master help file. However, I am unable to view the
extneral cnt file from the master cnt file, unless all cnt and hlp
files are installed in the same folder. Is it not possible to have
the external cnt files under a different folder? Thanks for any
assistance!Hi, SSchwa, and welcome,
I believe that you can keep the files in different folders
provided that they are in the help "search path". The following is
from Microsoft's WinHelp Author's Guide:
quote:
WinHelp now searches for Help files in the following
locations, in the order listed.
* If a path is specified, WinHelp first searches for the file
in the specified path. If the file is not found, the path is
removed and the following locations are searched.
* The folder of the current Help file.
* The current folder.
* The System subfolder of the Windows folder.
* The Windows folder.
* The folders listed in the PATH environment.
* The location specified in the Winhelp.ini file.
* The registry.
If WinHelp cannot find a Help file, it displays a dialog box
that enables the user to specify the location of the Help file. If
the users finds the file, WinHelp will add the location information
in the registry.
As far as registering the .hlp and .cnt files is
concerned, the registry key under which to do so is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Help
Pete -
I am trying to get MP3 versions of my non DRM protected songs onto a DVD so I can import them into my cars "Music Register".
There is no easy way to do this that I can see in Itunes . I follow this process..
Highlight the songs I want to copy in Itunes
Select Create MP3 version from main menu
Open up Finder Window showing the Itunes folder with the m4a and MP3 files newly created..
Go Up a directory or 2 to get the Artist 'folder'
copy that folder to my external drive
Delete the MP3 songs from the Itunes folder (I dont want duplicates showing) obviously
Delete the M4a songs from the external drive....
I have about 5000 songs so doing this manually is clearly a complete pain.
I dont think you can force it to create the mp3 files anywhere other than in the current folder in itunes unless someone tells me otherwise
More likely does anyone know of any other software to do this with less effort...
I confess to not being an Itunes fan at all I admit but I like the Match functionality so I keep it otherwise I would cheerfully chuck it in the bin...
Thanks in advance...It appears I have figured it out. You gotta go down to where it says Destination and tell Lightroom to Organize into One Folder.
-
Selecting pictures from the same folder in the main library
Hello,
Still related to the folders.
Is there a way to select, from the main library, all the pictures that belong to one given folder?
That would be usefull to me if I want to make a slide show and find a specific picture and want to get all the other pictures from this given folder but without leaving the main library window. That would allow me to select pictures from different folders without going to each folder everytime...
If this question makes any sense and you have the answer you're really good!
Sorry english is not my native language!
Thanks in advance.
Have a nice day
JPHi jpalbouy,
Before I can answer, I need to know what you mean by folders.
Do you mean an Album in the source column?
Do you mean a folder you created in the source column? -
Find text and replace with a pdf stored in the same folder
Hello,
I have a catalog that is updated every so often. I have written a script to find/replace the text from a .txt file. but i have a pdf that i want to insert that is part of it as well. Inside the .txt file i have the name of the document. and the pdf is stored inside the same folder as the original .indd and the .txt file.
can someone point me at some examples on how this could be done.
ThanksI use this script: it puts a txt in a text frame, check the overflow and find/replace some words with a pdf. Hope this is helpful.
Paolo
/************************FLOW************************************************
* This function looks for Overflows in the story and either resizes the *
* frame to the size of the margins (if necesary) or adds a new page and *
* a new frame, which is then linked to the previous frame.esizes the *
function flow(){
for(var i = 0; i < app.activeDocument.pages.count(); i++)
for(var b = 0; b < app.activeDocument.pages[i].textFrames.count(); b++)
if(app.activeDocument.pages[i].textFrames[b].overflows == true )
var currentPage = myDocument.pages[i];
var myPageNo = currentPage.name;
var currentFrame=currentPage.textFrames[b];
var e =currentFrame.geometricBounds[0];
var f =currentFrame.geometricBounds[1];
var g =currentFrame.geometricBounds[2];
var h =currentFrame.geometricBounds[3];
if(myPageNo %2==0){
var myMargins =currentPage.marginPreferences;
var a = currentPage.bounds[0]+myMargins.top;
var b = currentPage.bounds[1]+myMargins.right;
var c = currentPage.bounds[2]-myMargins.bottom;
var d = currentPage.bounds[3]-myMargins.left;
else{
var myMargins =currentPage.marginPreferences;
var a = currentPage.bounds[0]+myMargins.top;
var b = currentPage.bounds[1]+myMargins.left;
var c = currentPage.bounds[2]-myMargins.bottom;
var d = currentPage.bounds[3]-myMargins.right;
if (g < c)
currentFrame.geometricBounds = [a,b,c,d];
else if (g==c){
var newPage = myDocument.pages.add(LocationOptions.AFTER, currentPage);
currentPage = newPage;
myPageNo = currentPage.name;
if(myPageNo %2==0){
var myMargins =currentPage.marginPreferences;
var a = currentPage.bounds[0]+myMargins.top;
var b = currentPage.bounds[1]+myMargins.right;
var c = currentPage.bounds[2]-myMargins.bottom;
var d = currentPage.bounds[3]-myMargins.left;
var newFrame = currentPage.textFrames.add({geometricBounds:[a,b,c,d]});
newFrame.textFramePreferences.textColumnCount = 7;
newFrame.previousTextFrame = currentFrame;
else{
var myMargins =currentPage.marginPreferences;
var a = currentPage.bounds[0]+myMargins.top;
var b = currentPage.bounds[1]+myMargins.left;
var c = currentPage.bounds[2]-myMargins.bottom;
var d = currentPage.bounds[3]-myMargins.right;
var newFrame = currentPage.textFrames.add({geometricBounds:[a,b,c,d]});
newFrame.textFramePreferences.textColumnCount = 7;
newFrame.previousTextFrame = currentFrame;
//************************************END FLOW FUNCTION*********************************************
/*******************TextPlacer***************************
this script will add a text file in an existing text frame
Questo file deve essere copiato nella cartella Script di InDesign
function myGetBounds(myDocument, myPage){
var myPageWidth = myDocument.documentPreferences.pageWidth;
var myPageHeight = myDocument.documentPreferences.pageHeight
if(myPage.side == PageSideOptions.leftHand){
var myX2 = myPage.marginPreferences.left;
var myX1 = myPage.marginPreferences.right;
else{
var myX1 = myPage.marginPreferences.left;
var myX2 = myPage.marginPreferences.right;
var myY1 = myPage.marginPreferences.top;
var myX2 = myPageWidth - myX2;
var myY2 = myPageHeight - myPage.marginPreferences.bottom;
return [myY1, myX1, myY2, myX2];
/*******************ImagePlacer***************************
this script will addimages to the document by
substituting them with the name of the image file
between @s (file format included[@mypic.bmp@]),
selecting them from a specified file (see below)
and applying object styles to them, as well as
applying the right tab i necesary.
It then looks for overflows in the document. If an
overset is found, it will resize to margin size the
text frame and if overset continues, it will add a
new page and frame, which then will be linked
to the previous frame, allowing the story flow.
Questo file deve essere copiato nella cartella Script di InDesign
//Creates a new document using the specified document preset.
//Replace "myDocumentPreset" in the following line with the name
//of the document preset you want to use.
var myDocument = app.documents.add(true,app.documentPresets.item("Preset"));
//If the active document has not been saved (ever), save it.
if(app.activeDocument.saved == false){
//If you do not provide a file name, InDesign displays the Save dialog box.
app.activeDocument.save(new File("/Users/Paolo/Desktop/Documento.indd"));
function main()
var myDocument = app.documents.item(0);
var myPage = myDocument.pages.item(0);
var myTextFrame = myPage.textFrames.add({geometricBounds:myGetBounds(myDocument,myPage)});
myTextFrame.textFramePreferences.textColumnCount = 7;
myTextFrame.place(File("/Users/Paolo/Desktop/text.txt"));
//Place a text file in the text frame.
//Parameters for TextFrame.place():
//File as File object,
//[ShowingOptions as Boolean = False]
//You'll have to fill in your own file path.
//Define GREP search
var grepFind ="@@@.+@@@";
//Folders name where there are pdf, must be in the same place of the file
var myFiguresFolder = "testatine";
// Applied paragraph style
var myPStyle = myDocument.paragraphStyles.item("Paragraphstyle");
var NextPStyleCS = myDocument.paragraphStyles.item("Par_Style");
var NextPStyleEN = myDocument.paragraphStyles.item("Par_Style_en");
var NextPStyleDE = myDocument.paragraphStyles.item("Par_Style_de");
// Applied text style
var myCStyle = myDocument.characterStyles.item("text");
//Applied object style
var myOStyle = "";
var oStyle_1 = myDocument.objectStyles.item("Pictures");
var oStyle_2 = myDocument.objectStyles.item("Pictures");
var oStyle_3 = myDocument.objectStyles.item("Pictures");
//MEASUREMENTS
var maxWidth = 467; //Maximum width of an image
var maxHeight = 666; //Maximum Height of an image
var colWidth = 468; //Width of the main columb (340pt) + maximum Tab (128pt)
var maxTab = 0;
var xTab;
var xtTab;
var minTWidth = 340; //any image with a width below this will have the maximum Tab (maxTab) applied.
var PWidth; //Width of the Picture
var PHeight;//Picture Height
var myTotal;
//---------------------------------ALERTS---------------------------------\\
var notSaved = "Documento non salvato; devi prima salvare il documento";
var noFolder = "No such folder exists; "+myFiguresFolder;
var noImageMessage = "No Images were found";
var finished = " immagini sostituite"
//---------------------------------ALERTS---------------------------------\\
/************************END OF STORY*****************************************
* The object of this bit of programming is to add an empty paragraph break *
* at the end of the story, in order to make the actual script work in the case *
* that the LAST paragraph were a TABLE *
var findEnd_of_Story = "\\r(?=\\z)" //GREP for End of Story //
app.findGrepPreferences = NothingEnum.nothing; //
app.changeGrepPreferences = NothingEnum.nothing; //
app.findGrepPreferences.appliedParagraphStyle = myPStyle; //
app.findGrepPreferences.findWhat = findEnd_of_Story; //
var fItems = myDocument.findGrep(); //
var myC = fItems.length-1; //
if (fItems =!0){ //
do{ //
if (fItems.appliedParagraphStyle = myPStyle){ //
cItem = fItems[myC] //
app.changeGrepPreferences.changeTo = "$0\\r"; //
myDocument.changeGrep(); //
myC--; //
while (myC >= 0); //
try{
var myDocPath = myDocument.filePath; //Complete Path to the Current Document
catch (myError){
alert (notSaved);
//throw("");
return;
var myFFldr =Folder(myDocPath+"/"+myFiguresFolder); //Complete Path in which the figures to be placed should be found
if(myFFldr.exists){
flow();
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = grepFind;
var myFoundItems = app.activeDocument.findGrep();
var myCounter = myFoundItems.length-1
myTotal = myCounter+1;
for (i = myCounter; i >=0; i--) {
var myName = myFoundItems[i].contents.replace (/@/g, "");
app.selection = myFoundItems[i];
var fFig=app.selection[0];//Found text for
var cPStyle= fFig.appliedParagraphStyle;
var myFile = new File( myFFldr + "/" + myName);
if (myFile.exists) {
var cFig = fFig.place(myFile);
var sFig = cFig[0].parent;
switch (cPStyle){
case (myPStyle):
myOStyle =oStyle_1;
PWidth = sFig.geometricBounds[3] - sFig.geometricBounds[1];
PHeight = sFig.geometricBounds[2] - sFig.geometricBounds[0];
if (PWidth >= minTWidth){
xTab = (colWidth-PWidth);
else{
xTab =maxTab;
var currentPar = sFig.parent.paragraphs.item(0);
currentPar.leftIndent = xTab;
var nextPar= currentPar.insertionPoints[-1].paragraphs[0];
var nextParStyle = nextPar.appliedParagraphStyle;
if (nextParStyle == NextPStyleCS||nextParStyle ==NextPStyleEN||nextParStyle == NextPStyleDE){
xtTab = xTab
else {
xtTab = nextPar.leftIndent;
nextPar.leftIndent =xtTab;
sFig.appliedObjectStyle = myOStyle;
cPStyle = "";
break;
case (myPStyle):
myOStyle = oStyle_3;
sFig.appliedObjectStyle = myOStyle;
cPStyle = "";
break;
default:
myOStyle = oStyle_2;
sFig.appliedObjectStyle = myOStyle;
cPStyle = "";
break;
var oFig = sFig;
sFig = ""
flow();
//alert(myTotal + finished);
else{
alert(noFolder);
var myDocument = app.documents.item(0);
//Clear the find/change grep preferences.
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
//Set the find options.
app.findChangeGrepOptions.includeFootnotes = false;
app.findChangeGrepOptions.includeHiddenLayers = false;
app.findChangeGrepOptions.includeLockedLayersForFind = false;
app.findChangeGrepOptions.includeLockedStoriesForFind = false;
app.findChangeGrepOptions.includeMasterPages = false;
//Regular expression to use
app.findGrepPreferences.findWhat = "<(.+?)>";
//Apply the change to 24-point text only.
//app.findGrepPreferences.pointSize = 24;
//app.changeGrepPreferences.underline = true;
var myFoundItems = app.activeDocument.findGrep();
var myCounter = myFoundItems.length-1
myTotal = myCounter+1;
//alert("occorrenze" + myTotal);
app.changeGrepPreferences.changeTo= "$1";
app.changeGrepPreferences.appliedCharacterStyle= myDocument.characterStyles.item("head");
myDocument.changeGrep();
for (i = myCounter; i >=0; i--) {
var myName = myFoundItems[i].contents.replace ("/</g", "");
var myName = myFoundItems[i].contents.replace ("/>/g", "");
app.selection = myFoundItems[i];
var fFig=app.selection[0];//Found text for
var myCStyle = myDocument.characterStyles.item("head");
app.selection[0].applyCharacterStyle(myCStyle, true);
//Clear the find/change preferences after the search.
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
main(); -
Batch convert Pages files to Doc and stay in the same folder?
Hi there,
I use iWork '09 on Mountain Lion. I recently switched to Microsoft Word and prefer it over Pages (personal preference). However, I have nearly 1000 files on my computer that are in Pages format. I have extensively searched this issue in the Apple Support Communities and it appears that there are scripts that DO EXIST that batch convert Pages files into Word files. However, it appears that many of these scripts were built for older versions of iWork and therefore I run into various errors. For example, I used the script available at http://pagesfaq.blogspot.com/2008/01/export-folder-to-word-rtf-pdf-txt-or.html and click run but nothing actually happens (the script runs for less than a second, then I can click run again). I was able to use one script successfully (pasted below), but the only reason I can't use it is because it saves ALL my converted documents in one folder on my desktop and I would like a script that can save them in the original file were the Pages document is located.
So, is there an iWork '09 compatible script that can convert my Pages documents to Word documents and save them in the same folder as the original? Oh, and for an added bonus, it'd be cool if the script also deleted my Pages version after it was done with the conversion
--[SCRIPT batch_exportPages2DOC] (* Enregistrer ce script en tant que script ou progiciel. Exécuter ce script ou déposer l'icône d'un dossier sur son icône. Il ouvre tout document Pages du dossier et l' enregistre en fichier DOC dans le dossier "was_Pages_now_DOC". Celui-ci peut être sur le bureau ou dans le dossier "~/Documents". Si le GUIscripting n'est pas activé le script demande votre mot de passe pour l'activer. Le script récupère le dossier d'exportation par défaut dans le fichier de préférences de Pages. Éviter de cliquer durant l'exécution du script sauf évidemment pour sélectionner le dossier source. ************* Save the script as script or application bundle. Run it or drag and drop a folder icon on its icon. It opens every Pages's documents stored in the folder and save it as DOC file in a folder named "was_Pages_now_DOC". This one may be on the desktop or in the "~/Documents" folder. according to the property storeOnDesktop. If GUIscripting is disabled the script ask for your password to enable it. The script extract the default export path from the Pages's preferences file. Don't click when the script is running. Except, of course, to select the source folder. ************* Yvan KOENIG (VALLAURIS, France) 2008/04/20 2009/06/17 adapté pour format .doc 2009/12/13 updated for MacOs 10.6… *) property theApp : "Pages" property theExt : "pages" property nomDuRapport : "report_Pages2DOC.txt" property nom_du_dossier : "was_Pages_now_DOC" property storeOnDesktop : true (* true = dest folder will be on Desktop false = dest folder will be in "~/Documents" *) property msg1 : "" -- globale property msg90 : "" -- globale property msg91 : "" -- globale -- property msg92 : "" -- globale property msg94 : "" -- globale property msg96 : "" -- globale property msg99 : "" -- globale property rapport : "" -- globale property dossierDeStockage : "" -- globale property dossierParDefaut : "" -- globale property localExport : "" -- globale property newExt : "" -- globale property newType : "" -- globale property isOs4 : missing value -- globale property isOs5 : missing value -- globale property theMenu : missing value -- globale property menuExport : missing value -- globale property types : {{"doc", "SLDocumentTypeMSWord", 2}, {"pdf", "SLDocumentTypePDF", 1}, {"txt", "SLDocumentTypePlainText", 4}, {"rtf", "SLDocumentTypeRichText", 3}, {"rtfd", "SLDocumentTypeRichTextBundle"}, 3} --===== (* our settings *) property typeNum : 1 (* 1 = WORD, 2 = PDF, 3 = Txt, 4 = rtf, 5 = rtfd *) property theButton : missing value (* 1 button PDF 2 button Word 3 button RTF 4 button Standard *) --===== on run (* lignes exécutées si on double clique sur l'icône du script application • lines executed if one double click the application script's icon *) tell application "System Events" to set dossier to choose folder (* dans un bloc System Events pour avoir un titre de dialogue "localisé" • in a System Events block to get a localized dialog title. *) my commun({dossier}) -- my commun({"Macintosh HD:Users:yvan_koenig:Desktop:for_see:" as alias}) end run --===== on open (sel) (* sel contient une liste d'alias des éléments qu'on a déposés sur l'icône du script (la sélection) • sel contains a list of aliases of the items dropped on the script's icon (the selection) *) my commun(sel) end open --===== on commun(elems) my nettoie() my prepareMessages() tell application "System Events" if not (UI elements enabled) then set (UI elements enabled) to true (* Active le GUI scripting • Enable GUI scripting *) set titres to title of processes end tell -- to System Events if theApp is not in titres then my activateTheApp() (* Active et ferme la fenêtre du document créé à l'ouverture • Activate and close the doc's window created at opening *) set {newExt, newType, theButton} to item typeNum of types (* item 1 = {"doc", "SLDocumentTypeMSWord",2} item 2 = {"pdf", "SLDocumentTypePDF",1} item 3 = {"txt", "SLDocumentTypePlainText",4} item 4 = {"rtf", "SLDocumentTypeRichText",3} item 5 = {"rtfd", "SLDocumentTypeRichTextBundle",3} *) set sysAtt to (system attribute "sys2") if 4 > sysAtt then if my parleAnglais() then error "This script requires MacOs X 10.4 or higher !" else error "Ce script requiert MacOs X 1.4 ou ultérieur !" end if else if 5 > sysAtt then set isOs4 to true set isOs5 to false if my getVersion() < "4" then set theMenu to 3 set menuExport to 13 else set theMenu to 10 set menuExport to 9 end if else if 6 > sysAtt then set isOs4 to false set isOs5 to true if my getVersion() < "4" then set theMenu to 3 set menuExport to 13 else set theMenu to 10 set menuExport to 8 (* was a wrong 9 *) end if else set isOs4 to false set isOs5 to false if my getVersion() < "4" then set theMenu to 3 set menuExport to 13 else set theMenu to 10 set menuExport to 8 (* was a wrong 9 *) end if end if my fermeFenetres() (* • Close existing windows *) my afficheLeMessage(msg1) (* Éviter de cliquer… • Don't click… *) tell application theApp to set localExport to localized string "Export" set dossierParDefaut to my getDefaultExport() as text set rapport to "" set dossierDeStockage to my creeDossierDeStockage(nom_du_dossier) (* Unicode text *) try repeat with elem in elems try my exploreTraite(elem as alias, "") end try end repeat if rapport = "" then set rapport to msg90 -- crée un fichier texte sur le Bureau set p2d to path to desktop set p2r to (p2d as Unicode text) & nomDuRapport tell application "System Events" if exists (file p2r) then delete (file p2r) make new file at end of p2d with properties {name:nomDuRapport} end tell set rapport to rapport as text write rapport to (p2r as alias) on error MsgErr number NroErr if NroErr is not -128 then beep 2 tell application (path to frontmost application as string) to ¬ display dialog "" & NroErr & " : " & MsgErr with icon 0 buttons {msg99} giving up after 20 end if -- NroErr is… return end try my nettoie() if my parleAnglais() then my afficheLeMessage("Export done.") else my afficheLeMessage("Traitement terminé.") end if end commun --===== on nettoie() (* pour ne pas stocker dans le fichier script • So it will not be stored in the script file *) set dossierDeStockage to "" set dossierParDefaut to "" set rapport to "" set localExport to "" set newExt to "" set newType to "" set isOs4 to missing value set isOs5 to missing value set theMenu to missing value set menuExport to missing value set theButton to missing value set msg1 to "" set msg90 to "" set msg91 to "" set msg92 to "" -- set msg94 to "" set msg96 to "" set msg99 to " " end nettoie --===== on afficheLeMessage(m) beep 1 tell application (path to frontmost application as string) activate if my parleAnglais() then display dialog m buttons {" OK "} default button 1 giving up after 10 else display dialog m buttons {" Vu "} default button 1 giving up after 10 end if end tell end afficheLeMessage --===== on creeDossierDeStockage(Nom) (* S'il n'existe pas, construit un dossier destination sur le bureau ou dans "~/Documents" • If does not exist, create a destination folder on the desktop or in "~/Documents" *) local dd, dds if storeOnDesktop is true then set dd to path to desktop as Unicode text else set dd to path to documents folder as Unicode text end if if Nom ends with ":" then set dds to dd & Nom else set dds to dd & Nom & ":" end if (* dossierDeStockage n'existe pas, on le crée • dossierDeStockage is not available, build it *) tell application "System Events" to if not (exists item dds) then make new folder at end of folder dd with properties {name:Nom} return dds as Unicode text end creeDossierDeStockage --===== on exploreTraite(elem, ptree) (* elem est un alias • elem is an alias *) local elem_, cl_, type_Id set elem_ to elem as Unicode text tell application "System Events" to tell disk item elem_ set cl_ to class if cl_ is folder then set type_Id to "" else set type_Id to type identifier end if end tell -- "System Events" set cl_ to cl_ as Unicode text if type_Id is in {"com.apple.iwork.pages.pages", "com.apple.iwork.pages.sffpages"} then (* C'est un fichier Pages. • It's a Pages document *) my TraiteUnDocument(elem_) else if cl_ is in {"file package", "«class cpkg»"} then set rapport to rapport & msg91 & elem_ & return (* "Package", Attention, un package EST un dossier "spécial". • Caution, a package IS a "special" folder. *) else if cl_ is in {"folder", "«class cfol»"} then my ExploreUnDossier(elem_, ptree) else set rapport to rapport & msg92 & elem_ & return (* "Pas un document Pages". • "Not a Pages's document" *) end if -- typeId_ is … end exploreTraite --===== on ExploreUnDossier(dossier, ptree) local nomElement, cheminElement, c repeat with nomElement in list folder dossier without invisibles set cheminElement to dossier & nomElement tell application "System Events" to set c to name of (dossier as alias) my exploreTraite(cheminElement as alias, ptree & c & ":") end repeat end ExploreUnDossier --===== on TraiteUnDocument(leCheminOriginal_UniText) my export2Doc(leCheminOriginal_UniText as alias, leCheminOriginal_UniText) end TraiteUnDocument --===== on export2Doc(p, leCheminOriginal_UniText) (* • here p is the path as alias *) local flag, nom_de_p, nouveauChemin, w, bof, x, p_xport try tell application theApp open p set flag to false repeat 300 times (* Attends que le fichier soit réellement ouvert. • Wait until the file is really open *) if my getNbWindows() > 0 then set flag to true exit repeat end if end repeat end tell -- to theApp if flag is false then error number 8888 (* Le fichier n'a pu être ouvert. • The file can't be open. *) on error MsgErr number NroErr if NroErr = 8888 then set rapport to rapport & msg94 & leCheminOriginal_UniText & return else set rapport to rapport & "### " & MsgErr & " ### " & errNbr & return end if return (* can't do the remaining tasks *) end try tell application "System Events" to tell file leCheminOriginal_UniText set nom_de_p to name end tell -- System Events if nom_de_p ends with theExt then set nom_de_p to text 1 thru -(2 + (length of theExt)) of nom_de_p set nouveauChemin to dossierParDefaut & nom_de_p & "." & newExt --log nouveauChemin tell application "System Events" to if exists (file nouveauChemin) then set name of file nouveauChemin to nom_de_p & my horoDateur(modification date of file nouveauChemin) & "." & newExt (* name stamped *) try set {w, bof} to my getFrontWindow() tell application "System Events" to tell application process theApp click menu item menuExport of menu 1 of menu bar item theMenu of menu bar 1 (* Exporter… *) repeat until exists sheet 1 of window w delay 0.1 end repeat tell sheet 1 of window w (* sheet containing the buttons PDF, Word, RTF, Standard *) -- get properties of UI elements of radio group 1 if isOs4 then click button theButton of radio group 1 else if isOs5 then click checkbox theButton of radio group 1 else click radio button theButton of radio group 1 (* I hope that they will no longer change it *) end if -- isOs4 is true (* if typeNum is 2 then delay 0.2 tell pop up button 1 click click menu item quality of menu 1 end tell delay 0.2 end if *) click button 1 (* Suivant… *) repeat until exists button localExport delay 0.1 end repeat click button localExport (* Exporter… *) end tell -- to sheet… repeat 20 times if exists sheet 1 of window w then click button 2 of sheet 1 of window w (* "Ne pas consulter " dans éventuel rapport d'anomalies • "Don't review" in sheet reporting possible export anomalies *) exit repeat end if delay 0.1 end repeat end tell -- to process … System Events if dossierDeStockage is not dossierParDefaut then (* we must move the file from folder dossierParDefaut to folder dossierDeStockage *) set p_xport to dossierDeStockage & nom_de_p & "." & newExt tell application "System Events" to if exists (file p_xport) then set name of file p_xport to nom_de_p & my horoDateur(modification date of file p_xport) & "." & newExt tell application "Finder" to duplicate file nouveauChemin to folder dossierDeStockage (* • before 10.5, System Events is unable to move *) my wait4File(p_xport) tell application "System Events" to if exists file nouveauChemin then delete file nouveauChemin end if -- dossierDeStockage is not… my ferme1fenetre() on error errMsg number errNbr set rapport to rapport & msg96 & p & return & errMsg & " ### " & errNbr & return end try end export2Doc (* ===== • Build a stamp from the modification date_time *) on horoDateur(dt) local annee, mois, jour, lHeure, lesSecondes, lesMinutes set annee to year of dt set mois to month of dt as number (* existe depuis 10.4 *) set jour to day of dt set lHeure to time of dt set lesSecondes to (lHeure mod 60) set lHeure to round (lHeure div 60) set lesMinutes to (lHeure mod 60) set lHeure to round (lHeure div 60) return "_" & annee & text -2 thru -1 of ("00" & mois) & text -2 thru -1 of ("00" & jour) & "-" & text -2 thru -1 of ("00" & lHeure) & text -2 thru -1 of ("00" & lesMinutes) & text -2 thru -1 of ("00" & lesSecondes) (* • Here, the stamp is "_YYYYMMDD-hhmmss" *) end horoDateur (* ===== • Take care, the front window may be an Inspector or a dialog one. *) on getFrontWindow() local namesOfWindows, w, flag tell application theApp to activate set flag to false tell application "System Events" to tell application process theApp set namesOfWindows to name of every window repeat with w in namesOfWindows if subrole of (get properties of window w) is "AXStandardWindow" then set flag to true exit repeat end if end repeat end tell return {w, flag} (* • w is the name of the front document's window *) end getFrontWindow (* ===== • Wait that the file is completely written on disk *) on wait4File(p) (* • p must be Unicode text *) local oldSize, nnn, newSize set oldSize to 0 tell application "System Events" to set nnn to name of file p repeat try tell application "System Events" to set newSize to physical size of file p if oldSize < newSize then set oldSize to newSize else exit repeat end if end try end repeat end wait4File --===== on activateTheApp() local bof, status tell application theApp to activate if my getStartingStatus() is false then tell application "System Events" to tell application process theApp to keystroke return repeat set {bof, status} to my getFrontWindow() if status is true then exit repeat end repeat end activateTheApp (* ===== • Close existing open windows *) on fermeFenetres() repeat while my getNbWindows() > 0 my ferme1fenetre() end repeat (* • Now there is no open window *) end fermeFenetres --===== on ferme1fenetre() tell application theApp to activate tell application "System Events" to tell application process theApp to keystroke "w" using {command down} end ferme1fenetre --===== on getPlistValue(valName, default) local thePlist, u set thePlist to (path to preferences folder as Unicode text) & "com.apple.iWork." & theApp & ".plist" tell application "System Events" if exists file thePlist then tell contents of property list file thePlist try set u to (value of property list item valName) (* Unicode Text *) on error (* On est là si Pages n'a rien enregistré avec des préférences neuves • Here if Pages never saved with the new preferences file. *) set u to default end try end tell -- to contents of… else (* On est là s'il n'y a pas de fichier de préférences • Here if there is no preferences file. *) set u to default end if end tell -- to system events return u end getPlistValue --===== on getStartingStatus() return my getPlistValue("LSDefaultsUseDefaultStartingPoint", false) end getStartingStatus --===== on getDefaultExport() local u (* son of a *****, I forgot that they don't use the same name !! *) if theApp contains "Pages" then set u to my getPlistValue("SLDocumentDefaultExportDirectory", "~/Documents") else if theApp contains "Numbers" then set u to my getPlistValue("LSDocumentDefaultExportDirectory", "~/Documents") else error "I didn't coded a Keynote version !" end if set u to (POSIX file (do shell script "echo " & u)) as text if u ends with ":" then return u else return (u & ":") end if end getDefaultExport --===== on getNbWindows() tell application "System Events" to tell application process theApp to return count of windows end getNbWindows --===== on getLocale(a, x) tell application a to return localized string x end getLocale --===== on getVersion() try tell application theApp to return version on error return "1" end try end getVersion --===== on parleAnglais() local z try tell application theApp to set z to localized string "Cancel" on error set z to "Cancel" end try return (z is not "Annuler") end parleAnglais --===== on prepareMessages() if my parleAnglais() then set msg1 to "Don’t click when the script is running." & return & "Except, of course, if it ask for." set msg90 to "No problem during the export process." set msg91 to "Package" set msg92 to "Not a " & theApp & "’s document" -- set msg94 to theApp & " can’t read it" set msg96 to "Not copied." set msg99 to "Oops" else set msg1 to "Éviter de cliquer durant l’exécution du script" & return & "sauf s’il le demande." set msg90 to "Exportation réussie sans incident." set msg91 to "Package" set msg92 to "Pas un document " & theApp -- set msg94 to theApp & " n’a pas pu le lire" set msg96 to "Pas copié." set msg99 to " Vu " end if set msg91 to "### " & msg91 & " ### " set msg92 to "### " & msg92 & " ### " -- set msg94 to "### " & msg94 & " ### " set msg96 to "### " & msg96 & " ### " end prepareMessages --===== --[/SCRIPT]Try this app: http://tyorex.com/iWorkConverter
Batch convert Pages files to doc and pdf. -
Making hypertext work if things are NOT in the same folder?
I am writing a large doc with FM (FM 8.0p277), several appendix files, 100+pages, etc. I am using hypertext to link external PNG images with the document. This is working just fine (message openfile:filename.ext). Then, I print as PDF doc, and still keeping the PNGs and the newly created PDF in same folder- the hypertext link still works fine.
My question is: this document will be released to clients, whom we can't necessarily make keep all elements in the same folder. Is there a way, when I generate the PDF of the final version, for the hypertext link to work if things are moved out of the same folder? I'm guessing not, but I thought if anyone would know, it would be in this forum...
Thx
AdrianaIf everything is in the same folder when the PDFs are created, then the links should all be relative. As long as the distributed files are all kept together when distributed, then things should continue work. However, if they move some files to different folders, then all bets are off.
Why are you making external links to the graphics files instead of importing them by reference into the FM file - especially PNGs? This doesn't make any sense to me.
If you need to keep everything separate initially (for whatever reason), then consider creating a PDF portfolio in Acrobat, that can't be split up, as the final deliverable. -
-Settings
Exchange 2010 enterprise on-premise
Outlook 2013 std
Exchange Personal Archive
Feature : Option/Email/When Replying To A Message That Is Not In the Inbox, Save The Reply In The Same Folder
Hi,
the feature works fine in the mailbox of the user but not from within the exchange personal archive.
Instead the reply is saved in the send items folder of the mailbox.
Any suggestions how to make this work?
Best Regards,
zrvbAFAIK, that is how it is intended to work. The archive is considered as "old-emails" so the newly created reply doesn't fall within that category.
Contact Microsoft Support by phone to submit it as a bug when it is "unexpected behavior" from your point of view or otherwise as a feature request/design change.
Robert Sparnaaij
[MVP-Outlook]
Outlook guides and more: HowTo-Outlook.com
Outlook Quick Tips: MSOutlook.info -
Why all the videos are in the same folder
Hi,
Is there a way to put videos in a different folder or they always ended up in the same folder on the Ipod, any help would be ....
thanks
MikeMy 10 step solution
1. Plug in your Ipod and start Itunes.
2. Now in Itunes select your Ipod.
3. Then go to file and click on New Smart Playlist.
4. make sure that Match the following rule is checked.
5. What I did was change artist to album and give it a name such as horror or action then press ok.
6. now when your movies are in the ipod go to your movie and click on file and click on get info.
7. A window opens and click on the info tab and under album write what you wrote for the smart playlist such as action or horror and click OK.
8. it will update your movie depending on file size and length is how long it will take to update.( for me with a dual 2.7 g5 i waited like 3-5 mins for a 2:30 hr movie.
9. Once done it will be in your new folder.
10. Your Done
I hope this helps. -
I'm experiencing something odd that does not seem right. I am trying to embed an .swf file on a web page. I have the player file in a separate resource folder from the other files. In the object tags data attribute value, I am able to have the .swf file be in another folder. However, in the <param name="movie" value attribute, I am not. Can anyone tell me why?
<object id="Object1" type="application/x-shockwave-flash" data="../VideoResources/player_flv_maxi.swf" width="480" height="360"> THIS WORKS
< param name="movie" value="player_flv_maxi.swf" /> this works if I put a copy of the .swf file in the same folder as the .htm file (but I don't want to)
but this does not work if I put the .swl file in the a folder one level up (which I want to):
< param name="movie" value="../VideoResources/player_flv_maxi.swf" />
Thanks for any ideas.I copied the value from data attribute value and pasted it into the value attribute value...
Here is the entire code for the <object> tag.
<object id="Object1" type="application/x-shockwave-flash" data="../VideoResources/player_flv_maxi.swf" width="480" height="360">
<noscript><a href="youtube" _mce_href="http://www.dvdvideosoft.com/products/dvd/Free-YouTube-Download.htm">youtube">h ttp://www.dvdvideosoft.com/products/dvd/Free-YouTube-Download.htm">youtube video downloader</a></noscript>
<param name="movie" value="../VideoResources/player_flv_maxi.swf" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="opaque" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="quality" value="high" />
<param name="menu" value="true" />
<param name="autoplay" value="false" />
<param name="autoload" value="false" />
<param name="FlashVars" value="configxml=DVD_VIDEO.xml" />
</object> -
Images (and image folders) in the same folder as Lightroom Catalog?
I'm just switching over from Aperture 3 to Lightroom 4. I'm wondering if its ok (or smart) to keep the images (and image subfolders) in the same folder that the Lightroom.lrcat and Previews files are kept in. I'm trying to better organize my Pictures folder so that there are a whole bunch of separate sub-folders. Thoughts?
In Lightroom, there is no specific location where the photos should go. You can put them wherever you want, based upon your storage needs and hard drive setup.
So, with regards to your specific question, yes you can put the photos in the same folder as where the .lrcat is located, I can't see any harm, but I also don't think you need to do the work to make that happen. You can pretty much leave your photos where they are (which is easier and less time consuming) than moving them to the .lrcat folder, and easier and less time consuming than moving them at all.
In fact, I strongly suggest you change your thought processes from "Where do I put my photos" to "How can I organize my photos". Now that you are a Lightroom user, you organize your photos from within Lightroom, not by moving them here to there, but by adding keywords and other metadata. Organizing, now that you are LR user, is not folders ... it is metadata. Searching, now that you are a LR user, is not done in your operating system and in folders, it is done in LR by searching for keywords and other metadata.
Maybe you are looking for
-
Warning message in Query "Currency field CCCUR-WAERS will not be filled"
Hi I generated a infoset using table COSP, when I click in generate infoset, sap shows this warning message: Compare field group fields with Data Dictionary Currency field CCCUR-WAERS will not be filled Currency field TKA01-WAERS will not be filled H
-
Employee information under MSS
Dear Experts, Would you please help me how to activate the employee information iView under MSS- Team? Appreciate you help on this Thanks Jay
-
Yosemite working but iTunes will not launch
Finally got Yosemite running OK on my MBP even though I could not redownload it from the App Store. iTunes has not been working through this whole ordeal so that is not surprising (I thought). But I just did a complete download of the Yosemite Inst
-
How setup Airport Express time zone "Asia/Krasnoyarsk" automatically?
Hello! I need your support to understand how AirPort Express sets time zone automatically. I live in Krasnoyarsk, Russia. Upon connectin AirPort Express for the first time the time zone was set as "Asia/Hong Kong" and the box "Set time zone automatic
-
Hi i'm trying to sync my itunes library onto my new ipod but the message it cannot be synced because it cannot be found comes up