Support the development of a script of file-placement?
Chip Hello Folks,
Who we are: we are a small shop (OS X Leopard, CS4) designers in education non-profit. We use a script that was downloaded by Olav Kvern usefully in this forum, which then made us minor adjustments to, and works very well for us - it looks for a document and replaces the tag filenames inline graphics placed in a selected folder.
We recently realized there is a situation that seems to trigger the script each time - when we have several files to be placed on a single line. For example, if the script crosses
< < 12345a.eps > > [tab] < < 12345b.eps > > [para back]
... it will be the first file on the line, and then stop the script and remove the rest of the text on the line (ouch!).
Any suggestions on how to approach this would be appreciated. Script is below.
Thank you
Ian Carey
main();
main() {} function
myFolder is Folder.selectDialog ("select a file");.
If (myFolder! = null) {}
myReplaceGraphics (myFolder);
}
}
function myReplaceGraphics (myFolder) {}
var myInlineGraphic, myX1, myY1, myX2, myY2, myFoundItem;
myDocument var = app.documents.item (0);
myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
var myRegExp = "(?i) < <(.*)" > > ""
myDocument var = app.documents.item (0);
var myDoc = app.activeDocument;
myDoc.selection = NothingEnum.nothing; deselect all objects to avoid replacing the color of an object that could already be selected
myDoc.pageItemDefaults.strokeColor = 'None '; Set the color of outline by default document 'None '.
myDoc.pageItemDefaults.fillColor = "None" / / sets the color of filling by default document 'None '.
Clear the find/change grep preferences.
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = myRegExp;
Search in the document.
var myFoundItems = myDocument.findGrep (true);
Clear the find/change preferences after the search.
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
If (myFoundItems.length! = 0) {}
for (var myCounter = 0; myCounter < myFoundItems.length; myCounter ++) {}
myFoundItem = myFoundItems [myCounter];
myX1 = myFoundItem.characters.item (0) .horizontalOffset;
myY1 = myFoundItem.characters.item (0) .baseline;
Change the following values to change the size of the image.
myX2 = myX1 + 72;
myY2 = myY1 + 72;
myFileName = myFoundItem.contents.replace (/ < <(.*) > > / i, '$1');
CheminMonFichier = myFolder + "/" + myFileName.
$.writeln (myFilePath);
myFrame = myFoundItem.insertionPoints.item (0).rectangles.add ();
Recompose text after you add the inline frame.
myFoundItem.parent.recompose ();
myFrame.geometricBounds = [myX1, myY2, myY1, myX2];
try {}
myInlineGraphic = myFrame.place (File (myFilePath)) [0];
myFrame.fit (FitOptions.frameToContent);
} catch (myError) {}
}
}
Now replace the tags.
app.findGrepPreferences.findWhat = myRegExp;
app.changeGrepPreferences.changeTo = "";
myDocument.changeGrep ();
Clear the find/change preferences after the search.
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
}
Thanks for posting using scripts > advanced Java syntax highlighting in the editor.
Your problem seems to be that this regexp:
var myRegExp = "(?i)<<(.*)>>"
Gourmand and corresponds to all of the first < to="" the="" last=""> >. (In addition, the line is missing a semicolon).
Try to replace it with:
var myRegExp = "(?i)<<(.*?)>>"
to turn off the greediness.
Tags: InDesign
Similar Questions
-
PS 13 element has a current update that will support the RAW of Sony DSC RX100M4 files?
Recently updated my camera Sony DSC RX100 recently published RX100M4 DSC and 13 items does not support the RAW format. I can use only jpg files. Outside the PS Elements, I use a file converter, but that defeated the purpose of the use of RAW. All solutions
Reluctant acceptance that I will be driving a car from Adobe with 3 wheels until the release of PSE14 will include a car with 4 wheels. Too bad.
-
This is the right forum to ask questions about the development of .vbs script?
Please feel free to point me in a direction different/various forum as appropriate.
My goal is to automate the replacement of the connection on a Win7 x 32 machine wallpaper using vbscript. I know which will involve a change of register, create a folder and copy my image in the new folder. I can't use a packaged solution, because it's for my PC to work (outside the unauthorized programs), and I don't want to take the time to do this manually every time I'm on another PC or a virtual PC that is cleared to a State of origin on a regular basis.
If anyone knows a vb script that already does, it's phenomenal. If this isn't the case, I try to find the best MS community forum to ask questions of syntax when working on the VBscript code.
Thank you.
Thank you - this site seems to be a few articles, but research on MSDN brought me to
http://social.msdn.Microsoft.com/forums/vstudio/en-us/home?Forum=vbgeneral
That seems to be a good fit.
Thank you!
-
help to the development of a script of locking
I have this script that sets all the fields to read only when I submit. What I have to change on this script so that it re - activate all fields again?
I thought changing the "readOnly" to "activate", but it did not work
Download area of each page containers.
for
()var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) { }
var
oFields = xfa.layout.pageContent (nPageCount, "field");
var
nNodesLength = oFields.length;
Set the field property.
for
()var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) { }
oFields.item (nNodeCount) .access
= "readOnly";
}
}
Hello
If you look in help for the LC Designer, you will see that the .access property has a number of possible values. You are looking for is "open".
Hope that helps,
Niall
-
Is it possible to save an action to convert from sRGB to CMYK, then use the action in a script to support the process of a folder full of images?
Do action, and run as a batch of PS (file > Automate > batch), or bridge (Tools > Photoshop > batch).
Pay special attention to all the 'destination', 'save' and 'close' steps. You want to save a copy without overwriting the original, which can easily happen.
-
Hello, need help for Adobe Reader DC playing animation files that are specified in the pdf output by script Latex Beamer. My Adobe Reader DC refuse to open any format that I gave him. Thank you very much
Hey ihorl18351266,
Please note that you can open PDF files using only the CD player. Any other format will not be supported by the software.
Kind regards
Ana Maria
-
Hello
I have a request ('A') that I am trying to build another application ("BuildA").
I can create a request for A manually of its project using the Build specification, and it works fine (A.exe).
Also, when I run BuildA.vi in the development environment he calls the "Build.vi" properly and again generates application A.exe very well.
Then, when I ask BuildA (manually) and run BuildA.exe, I would expect that it also creates A.exe as BuildA.vi did in the development environment.
However, it fails with the error:
Code: 1025
Reference VI opened in .vi NI_App_Builder_API.lvlib:Build (path)-> BuildA.vi
Path of the VI: C:\TEMP\AppBuild\BuildA\vi.lib\AppBuilder\BuildTarget.viI noticed this thread , which looks like a similar problem, but has reached no conclusion.
Why BuildA.vi works fine in the LabVIEW environment, but the application that builda.exe does not work? All paths are hard-coded, so it shouldn't be a path problem.
Thank you
-john
eye_in_the_sky wrote:
I guess we will have to keep the application building separated the disappointment... automated scripts
There are still other options. Lets say configure you VI to run then. If you ran the following command from your script line
"C:\Program NIUninstaller Instruments\LabVIEW 2011\LabVIEW.exe" "C:\BuildA.vi".
It would then open your BuildA.vi in LabVIEW and run in the development environment.
-
Original title: Windows Media Player shows that the new codecs are required
Original title: query codec and Media Player re
Have used windows media player for many years on my dell. Usually to see the videos from Sony handycam. Just downloaded wmediaplayer and recent videos from Camcorder will not open one of the videos.
The following message is displayed "Windows Media Player cannot play the file. The player might not support the file type or a required codec may not be installed on your computer. »
As I have not changed anything helpful suggestions please.
concerning
The winemaker
Hello
1. What is the format of the video file?
2. what operating system is installed on the computer?
Method 1: Run the troubleshooter in Windows Media Player on Windows 7 settings:
http://Windows.Microsoft.com/en-us/Windows7/open-the-Windows-Media-Player-settings-Troubleshooter
Method 2: You can check if the file format of the music files are supported by Windows media player using the link below.
Information on the types of media files that supports Windows Media Player
Note: If you have tried to play the file type is included in this table, the file might have been encoded with a codec that is not supported by Windows Media Player. If this is the case, Windows Media Player cannot play the file.
Method 3: In addition, you can also download & install the necessary codec to play the files.
For more information, see: Codecs: frequently asked questions
(For Windows Vista)
WARNING of THIRD PARTY SOFTWARE: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.
Hope this information is useful.
-
The problem is that Windows Media Player cannot play the file. The error that says"the player might not support the file type or does not support the codec used to compress the file.
The properties of the file are:
3GP.PNG
Hyper Text Transfer Protocol
TYPE: A PNG Image
How can I fix?
The problem is that Windows Media Player cannot play the file. The error that says"the player might not support the file type or does not support the codec used to compress the file.
The properties of the file are:
3GP.PNG
Hyper Text Transfer Protocol
TYPE: A PNG Image
How can I fix?
Windows gives you integrated programs to open the image as png files.
In Vista, use Windows Photo Gallery to open png files.
In Windows 7, if you use it, you can use Windows Photo Viewer to open png files.
If you have installed Windows Live Essentials, you can use Windows live Photo Gallery to open png files.
-
Original title: MP3 downloads don't play no not on WMP
My Windows Media Player recently stopped playing downloads from Amazon. I've never had this problem before. I installed VLC Player, has not worked... off the WMP in the Windows app, restarted, turned on the back and restarted... did not help. I get the message "Windows Media Player cannot play the file. The player may not support the Codec used to compress the file. This is for multiple downloads, so I don't think they would be all corrupted files.
HelloHave you done any software or changes to the material on the computer before this problem?You mentioned that the files do not play on a third-party player as well. I suggest you to check if the files are corrupt.Method 1:How to Download Codecs automatically in Windows Media for Windows XP player
Method 2:Resolution of the problems of reading in the Windows Media Player for Windows XP
Information on the types of media files that supports Windows Media Player
In addition, run the fixit from the link:Hope the information is useful. -
Original title: WMP "can't play wav or midi.
Using WMP 11 on Windows XP SP3.
Windows Media Player has somehow forgotten how to play wav or midi files. Doubleclicking either of these file types give an error "Windows Media Player cannot play the file. The player might not support the file type or does not support the codec used to compress the file. " There is a button 'Close' and 'Web Help' which still informs me, "you met the C00D1199 error message... ". ». Following the advice given nothing less than useful.
I can easily play these files with RealPlayer or VLC so I don't think it's a driver problem, and it wasn't a corruption right after installing the other players. WMP seems to work OK when playing music or AVI. And there is no harm to hear a sound (wav or midi) in Windows for various system events. Have already uninstalled/reinstalled WMP without result.
Thanks for your reply.
I have since determeined the problem comes from an updated codec package I installed a few weeks ago. These codecs were from Shark007 which I believe is a Microsoft MVP. Use the codecs from this site for a number of years without any problems so I did not initially suspect it was the source of the problem. I uninstalled the codec pack and installed K-light package and everything seems to be Ok now. Now, I'll be in contact with the members of this forum.
-
Original title: help and Support.
Open windows help (HTML) and Windows Help and support of the 100... each program file, I open... I disabled the assistance and support of windows, it did not stop... PL, help me...
I once formatted the c drive, but it did not stop... It consumes the pagefile (util) and more problem occure... Please help me!
Hello
Step 1: Search for the issue in the clean boot state.
Step 2: Online virus and malware scanner and check.
http://www.Microsoft.com/security/scanner/en-us/default.aspx
Step 3: Also, look for error messages in the event viewer. If you find error messages after return the exact error message so that we can help you better.
Reference:
Using the event viewer
Understanding of event viewer
Procedure to view and manage event logs in Event Viewer in Windows XP
-
the Player Windows media doesn't let me see the photos sent by e-mail. says unable to read file [oxcood1199]. State id oxoooooooo. does not support the format or corrupted file. the file is not corrupted. can not send email. just started using a hotmail account.
Install Windows Live Photo gallery from the link below
http://explore.live.com/Windows-Live-Photo-Gallery-XP
Good luck!!
-
Cannot read iTunes from USB. Windows media player cannot play the file. The player might not support the file type or does not support the codec used to compress the file?
Ask the question in the Apple Forums:
https://discussions.Apple.com/index.jspa -
I tried to open a message sent by Chris Veit of Creative Memories. This is the error message I get:
Windows Media Player cannot play the file. The player might not support the file type or does not support the codec used to compress the file.
I'm technologically challenged! Specific remedies have greatly appreciated.
original title: Windows Media Player error message
OK... sounds like you have just a link to
something that is archived online.Maybe you could go to the website of House
and get some information about the media file.
Maybe you are looking for
-
Hello. Today, I noticed that I have lost 80% of the names and addresses I had in my file of Contacts on my iMac. I still have the complete list on my iPhone. My iCloud Contacts settings are on my phone and computer. How do I transfer my contacts list
-
Picked up my Macbook to the table and these lines appeared. First time that's ever happened. Any info on what happened actually technically? Thank you.
-
Firefox freeze for all 10-15 seconds on some websites.
When I am browsing of sites on the internet, most operate normally. But there's a lot that when I go to these Web sites, freeze firefox completely for about 10-15 seconds before returning to normal. I've included the url for 2 sites that it does on.
-
How can I clear the notifications from the notification Center while I can not click on the delete button? I have an iphone with ios 9.3 6
-
With losing connectivity problems so decided to update v1.00.7 firmware to the latest version available. Download the upgrade file and log into the web-based administrator. Select file, and then click the UPGRADE button. A few clicks on the timelin