Script for renaming postscript files
I need a script that will rename a postscript file at the time of printing. Ideally, after you hit the print button, a field would appear for you to enter the new name of the postscript file prior to sending it on to the printer. After you entered text, you hit enter again and the file goes to the printer for printing. The print log would show the new name. If anyone knows how to do this, I would appreciate your assistance. I could probably get you some cash.
Thanks,
Rich
This forum is for scripting questions rather than script requests.
Please start by reading the following:
Posting guidelines
Handy tips for posting to this forum
How to ask questions in a technical forum
Rubber duck problem solving
How to write a bad forum post
Help Vampires: A Spotter's Guide
-- Bill Stewart [Bill_Stewart]
Similar Messages
-
Need Shell Script for picking the files
Hi,
I want to write a shell script for piking the files in a sequence order (according to filename with time stamp) from the sorce FTP server ..
Requirement is in the source directory I'm getting files (Jain_1.xml , Jjain_2.xml, Jain_3.xml .. ect..) at present my file adapter is picking all the files at a time but i want to pick one by one... that to first i want to Jain_1.xml after finish the processing of the file then only my file adapter should pick the next file ( Jain_2.xml ) .
so.. all the forum mates suggest me to write a shell script.. but where i have to write the s hell script. and where i have to deploy this script.... my Xi is running on UNIX ... so please sugest me the procedure ...
Regards
JainHi,
Why dont you use the option EOIO in which files will be picked up in order and will be proccessed in sequence....one after another....
Regards,
Sreeni. -
Script to rename multiple files
I have about 30k image files on my pc in 1 dir C:\TEMP1\ for example. These files all have to be renamed to a specific unique name. Aside from these files I also have an xml file that contains properties for these files, document title, document id for example.
The xml file also contains the path and file name of the image files. I need a script that can read the xml file, find the tag <ExternalRef> and then go out to C:\TEMP1\ and rename that file according to other xml tags such as document title and document
id. I have 1 xml file for all 30k images. I dont have any scripting experience and was looking for some help.
This is what the xml file looks like: So I need to find <ExternalRef>file://C:\TEMP1\000E57BC.TIF</ExternalRef> and rename that file to <DocumentTitle>Probate Order-SO</DocumentTitle> _<ABC_DocumentID>APO24L977</ABC_DocumentID>...etc
- <ABC_TitleDocument>
- <ABC_TitleDocumentProperties>
<ObjectType>1</ObjectType>
<Creator>Administrator</Creator>
<DateCreated>2013-10-07T16:45:27.237Z</DateCreated>
<LastModifier>Administrator</LastModifier>
<DateLastModified>2013-10-07T16:45:27.237Z</DateLastModified>
<Id>6132c424-007b-4ef9-9c07-2b8171b83357</Id>
<Name>Probate Order-SO</Name>
<SecurityPolicy />
<SecurityParent />
<IsFrozenVersion>0</IsFrozenVersion>
- <VersionSeries>
- <ObjectRef>
<ObjectId>1be7c26c-89d2-40bf-afeb-a081714e470a7</ObjectId>
<ClassId>01a3a8c8-7aec-11d1-a31b-a0020af9fbb1c</ClassId>
</ObjectRef>
</VersionSeries>
<MajorVersionNumber>1</MajorVersionNumber>
<MinorVersionNumber>0</MinorVersionNumber>
<VersionStatus>1</VersionStatus>
- <ContentElements>
- <ContentTransfer>
<ObjectType>1038</ObjectType>
<ContentType>image/tiff</ContentType>
<RetrievalName>000E57ABC.TIF</RetrievalName>
<ExternalRef>file://C:\TEMP1\000E57BC.TIF</ExternalRef>
</ContentTransfer>
</ContentElements>
<MimeType>image/tiff</MimeType>
<DocumentLifecyclePolicy />
<DocumentTitle>Probate Order-SO</DocumentTitle>
<SourceDocument />
<OwnerDocument />
<PublicationInfo />
<IgnoreRedirect />
<EntryTemplateObjectStoreName />
<EntryTemplateLaunchedWorkflowNumber />
<EntryTemplateId />
<ABC_Area>P</ABC_Area>
<ABC_DocumentCategory>Title</ABC_DocumentCategory>
<ABC_DocumentClass>11</ABC_DocumentClass>
<ABC_DocumentID>APO24L977</ABC_DocumentID>
<ABC_LandArea>151</ABC_LandArea>
<ABC_ScanDate>2013-10-07T05:00:00Z</ABC_ScanDate>
<ABC_ScanOperator>Administrator</ABC_ScanOperator>
<ABC_ScanWorkstationID>SCN04:Sess 3</ABC_ScanWorkstationID>
<ABC_Agency>03</ABC_Agency>
<ABC_DocumentType>ABC</ABC_DocumentType>
<ABC_LTRO>P</ABC_LTRO>
<ABC_KofaxID>{DA701CAD-5CB2-444e-9ABBB-47CF0B2FD801}</ABC_KofaxID>
<ABC_DocumentCount>11</ABC_DocumentCount>
<ABC_Recordable>1</ABC_Recordable>
<ABC_BatchType>FOLLOW-UP</ABC_BatchType>
<ABC_EStamped>0</ABC_EStamped>
<ABC_RecordationState>PENDING</ABC_RecordationState>
<ABC_FileName />
<ABC_FolderName />
<ABC_BatchName>10/7/2013 8:25:26 AM</ABC_BatchName>
<ABC_RecordDate>11/19/2004</ABC_RecordDate>
<ABC_DocumentDate>1977-03-30T05:00:00Z</ABC_DocumentDate>
<ABC_ConveyanceType>SO</ABC_ConveyanceType>
</ABC_TitleDocumentProperties>
</ABC_TitleDocument>I'm still quite new to this, but I think this would do the trick based on what you've supplied, note the -whatif so it doesn't screw up if the output isn't quite what you want.
[xml]$fileinfo = Get-Content -Path .\fileinfo.xml
foreach ($doc in $fileinfo.ABC_TitleDocument) {
$filepath = $doc.ABC_TitleDocumentProperties.ContentElements.ContentTransfer.ExternalRef -creplace "file://",""
$fileext = (Get-Item -Path $filepath).Extension
$newfilepath = "$($doc.ABC_TitleDocumentProperties.DocumentTitle)_$($doc.ABC_TitleDocumentProperties.ABC_DocumentID)$fileext"
Rename-Item -Path $filepath -NewName $newfilepath -WhatIf -
Script for rename the pictures name as login names
I have staff pictures (100+) and pictures name as ID of staff. But I want to rename all with login names. any idea of writing a script?
Best
lasanthaHi Lasantha,
Please refer to the following post related to renaming user profile thumbnail.
https://blogs.blackmarble.co.uk/blogs/rhepworth/post/2010/07/29/powershell-script-to-rename-files-for-use-as-sharepoint-2010-user-profile-thumbnails.aspx
Please don't forget to mark it answered, if your problem resolved or helpful. -
Using a script to rename a file from the file info cart Cut Num (ID)??
Hi,
Can any of you guys tell me if its poss to do a script to rename a wav with the file info, cart, Cut Num ID field....??? (Cart chunks)
Example file at the moment is called {C5E5F0FE-57D9-4A9A-8DA1-58D1AE7017FD}.wav and I want to grab the info out of the File info, cart section, under Cut Num (ID) which has 9558 in it and rename the file so it is now 9558.wav when it saves or just renames it.I also then want to run the script as i have 6000 plus wav,s to do this too.
Thanks for any info.
Glen>Can any of you guys tell me if its poss to do a script to rename a wav with the file info, cart, Cut Num ID field....??? (Cart chunks)
No, scripts in Audition won't let you do this at all. In fact, Audition's scripting function really isn't very file-friendly, relating pretty much just to basic Audition functionality. And there's no way that an Audition script would let you rename a file anyway - they the closest they get to handling any file-related functions is that you can open a designated noise reduction profile - but that's about it.
There's one place that I know of where you might find a utility to do what you want -
here (try WidgetPro). -
A script for copying smilar files to a new location
Hi,
i newbies to scripting. My challenge is that I want a script to only copy files with names "similar" and not "exactly the same" as the filenames in the text file.
For example some files have 10 letters file name like "ABC01FGH01.tif". I have to copy file where starting letter "ABC" and middle letter "FGH" of file name are fixed, but other letters are changed.
The script sees a file name like "ABC**FGH**.tif", it should search the source location and copy the files having filenames with at least this characters e.g. "ABC02FGH02.tif", "ABC03FGH04.tif" should be copied since it has
contains "ABC**FGH**.tif".
Please help.Learn how to use wildcards in file names. '*' is for any number of characters and'?' is for one character.
COPY ABC??DE???.?x? c:\target
Start by using DIR
DIR ABC??DEF???JK.?x?
¯\_(ツ)_/¯ -
Script for moving & deleting files
Hi
I'm quite new to scripts & looking for a script to move selected files with time-stamp & also a script to delete selected file/s in a directory. Below is an example of my requirement
Move
Ex: c:\work\source\test.txt to c:\work\target\test.txt_04202015022100
Delete
Ex: c:\work\target\test-1.txt
Could someone help me please.
Thank very much
NeilThis forum is for scripting questions rather than script requests.
Please start by reading the following:
Posting guidelines
Handy tips for posting to this forum
How to ask questions in a technical forum
Rubber duck problem solving
How to write a bad forum post
Help Vampires: A Spotter's Guide
-- Bill Stewart [Bill_Stewart] -
Is there a script for renaming layers in ID CS5?
Hello,
I am new to scripting (I just started today) so far I have found some very useful existing scripts to help automate my workflow. I am wondering if anyone knows of the existence of a layer renaming script for InDesign.
I have seen similar scripts for PS. I want to learn how to script but I am in need of this one for Monday...
Thanks in advance!Antonio:
Please remember that we're all volunteers here. If you can ask your question so we can understand it, we can probably help you. But if you cannot, it would take quite a lot of effort on our part to even determine what you asking.
Jongware wrote in the other thread:
This is quite a specialized case so it's unlikely there "is" a script. But there "could be" one. Ask in the scripting forum, as there are some people in there sharpening their skills with such requests. Make sure to detail what you need it to do: which layers? rename to what? Et cetera.
You're not doing a good job on detail. How would the script know what to change your first, 3rd, 4th, and 5th "atoms" to?
You have given us no information that I can see. -
Script for emailing multiple file types?
Is there a script that will allow me to place a button on a form, that when clicked, will email the completed form in PDF format as well as in csv, or xml format?
Thanks!Wow, thanks. That was extremely helpful, but I have a couple questions.
First, is there a way to make it print to CUPS without opening the default application for the particular file first? For example, I used a .docx file, and it had to open microsoft word to send the job the print. This makers it very unpredictable to decide how much time the automator application will need to pause. If that file were for example, and adobe illustrator file, it would take an incredible amount of time just for illustrator to open. I don't really anticipate needing to do this a whole lot with anything other than text files and standard image types, but is that the only way for those other files to print? I figured that since OS 10.6 can do a quick look preview on just about any file type I use, that the OS would be able to do this without the application actually opening, but it seems not to be the case. Just wondering.
The other issue is the only real problem, and it's one that I have had whenever I use automator to make PDFs. It always duplicates the job. So, I am getting a combined pdf, but it has the same file in there 2 or even 3 times.
In automator, I used:
get selected finder items
then
print finder items
I have verified that it is printing everything multiple times because I see them going into the CUPS folder twice. Then, the final PDF sometimes even has the same doc or image in it 3 times. I have always had this problem with automator and PDFs, any idea how to solve that?
Other than that duplication issue, this seems like it will work perfectly! Thanks for the reply here! -
PHP Upload script for ZIP/SIT files
Hi,
I'm trying to locate a decent script that would allow clients
to upload files to a Web site that I am working on. I found a basic
one that works at www.w3schools.com/PHP/php_file_upload.asp.
However, it lack the capabilities to upload zip and sit files.
Could I modify the existing script that I just mentioned?
Unfortunately, I am not very PHP saavy. I have been Googling for
such a script but have not found one yet. I hope some one could
recommend a decent script. Thanks..oO(Mark A. Boyd)
>Carlton Chin posted in macromedia.dreamweaver.appdev:
>
>> I'm trying to locate a decent script that would
allow clients to
>> upload files to a Web site that I am working on. I
found a basic
>> one that works at
www.w3schools.com/PHP/php_file_upload.asp.
>> However, it lack the capabilities to upload zip and
sit files.
>> Could I modify the existing script that I just
mentioned?
>
>The ticket is where the script is checking
$_FILES["file"]["type"].
>See
http://www.w3schools.com/media/media_mimeref.asp
>
>If you only want to allow zip/sit, try changing this:
>
><?php
>if ((($_FILES["file"]["type"] == "image/gif")
>|| ($_FILES["file"]["type"] == "image/jpeg")
>|| ($_FILES["file"]["type"] == "image/pjpeg"))
>&& ($_FILES["file"]["size"] < 20000))
Be careful. These informations can be faked or might not be
available at
all. I can easily upload a PHP script as "image/jpeg". If the
file ends
up in a public directory within the document root, I can
execute it and
then have a look at the entire server ...
Relying on the content type or file extension is a huge
security hole!
I'm quite surprised that W3Schools publishes such an insecure
script.
To make sure that an uploaded file is really of the type you
expect, you
must look at its content! For images you can use
getimagesize(), which
will also return the type if it's a valid image. For other
types you
have to use other libs or external tools. On a *nix machine
you could
execute the shell command 'file' for example, which
recognizes quite a
lot of different file types.
Micha -
Error: run postflight script for adobe common files
error: run postflight script for adobe common files
I am sorry can you please restate your inquiry. If you can provide some more details regarding which Adobe Software you are inquiring about? Which operating system are you using? Finally what are you trying to accomplish when you receive this error?
-
Script for renaming selected shape layer items
Does anyone know if such a script exists?
That is to say, a script that renames the selected sub-items of a shape layer (paths, groups, shape generators etc).
Am aware there's already scripts to rename selected layers and layer masks. Have attempted to rewrite these to deal with shape layer items, but to no avail.
Many thanksI was able to rename them using these:
"Path 1"
app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Shape - Group").name = "MY NEW PATH NAME";
"Shape 1"
app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Graphic - Stroke").name = "MY SHAPE NAME";
"Fill 1"
app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Graphic - Fill").name = "MY FILL NAME";
"Group 1"
app.project.item(1).layer("Shape Layer 1").property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Group").name = "MY GROUP 1 NAME"; -
Apple Script to rename single files in folders
Hey guys, I am trying to write a script to automatically rename a lot of files. Here is the situtation:
I have a MainFolder with many SubFolders inside. Inside each SubFolder is 1 word document. Is there a way to write a script that automatically renames each of of those word documents to its folder's name. Example.
BEFORE:
-SubFolder1 - 1.doc
-SubFolder2 - 1.doc
-MainFolder -SubFolder3 - 1.doc
-SubFolder3 - 1.doc
AFTER:
-SubFolder1 - SubFolder1.doc
-SubFolder2 - SubFolder2.doc
-MainFolder -SubFolder3 - SubFolder3.doc
-SubFolder3 - SubFolder4.doc
Thanks.The following script should do what you are asking for:
set mainFolder to choose folder
tell application "Finder"
repeat with thisFolder in (get folders of mainFolder)
try
set name of (file 1 of thisFolder whose name extension is "doc") to (name of thisFolder & ".doc")
end try
end repeat
end tell
If there's just one file in each subfolder (wich is not exactly the same as “one Word document”), you could remove the “whose name extension is "doc"” filter. -
Script for generating XML file ... problem with null values
Greetings everyone,
i come here with a question that troubles me for some time now. I have a script which i run from SQLPLUS every now and then to generate an XML file.
Problem is that data which needs to be in XML is not allways <> NULL and i need to hide those tags that are empty </tag>.
I will post below my script and if you could help me with it it would be really great!
Thanks for reading!
set long 20000000
set long 20000000
set linesize 32000
SET ECHO OFF
SET TRIMSPOOL on
SET HEADING OFF
SET PAGESIZE 50000
SET VERIFY OFF
SET FEEDBACK OFF
SET TERMOUT OFF
spool C:\test.xml
set serveroutput on
begin
dbms_output.put_line('<?xml version="1.0" encoding="utf-8" ?>');
end;
SELECT
XMLELEMENT("ReportRoot",XMLATTRIBUTES('http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi", 'http://www.w3.org/2001/XMLSchema' as "xmlns:xsd" , '1.0' as "Version",sysdate as "CreationDate",to_char(sysdate,'hh:mm:ss') as "CreationTime",'1524544845' as "id"),
XMLELEMENT("Porocila",XMLELEMENT("JOLY",(SELECT XMLAGG (XMLELEMENT("RefNrReport",replace('SON'||to_char(ref_ST,'00000'),' ',''))) from access_table_2 where ref_ST = &1),
XMLELEMENT("ReportDate",sysdate),XMLELEMENT("Labeling",'545254450'),
(SELECT XMLAGG (XMLELEMENT("Reportf",
XMLELEMENT("access",access),
XMLELEMENT("date",date),
XMLELEMENT("datep",datep),
XMLELEMENT("ModificationInfo",'M'),XMLELEMENT("ModificationReason",modireason)))
from v_xml_test where id_dok = &1 and ind_print = '1'))))
.extract('/*')
from dual
spool off
exitNow lets pretend that XMLELEMENT("datep",datep), is sometimes NULL and i do not want to display it.may be
with t as
select sysdate datep from dual union all
select null datep from dual
select xmlagg(xmlelement("Reportf",
case when datep is not null then XMLELEMENT("datep", datep)
end
from t -
A script for copying certain files to a new location
I have a folder with over 50,000 images in it. I need about 15,000 of them copied to another folder.
Is there a script (that I can paste the list of the ones I need copied) to perform this action?
Thanks in advance.perhof,
After much googling, I was fortunate enough to find your beautiful script!
I added a couple of things like subfolder recusion ( by tweaking scripts I found) .
Would you be kind enough to look this over and see if it's ok or needs fixing?
Thanks for any help,
ec
[code]
' Read a list of images from text file
' and copy those images from SourceFolder\SubFolders to TargetFolder
' Should files be overwriten if they already exist? TRUE or FALSE.
Const blnOverwrite = TRUE
Dim objFSO, objShell, WSHshell, objFolder, objFolderItem, strExt, strSubFolder
Dim objFileList, strFileToCopy, strSourceFilePath, strTargetFilePath
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set WSHshell = CreateObject("WScript.Shell")
Const ForReading = 1
' Make the script useable on anyone's desktop without typing in the path
DeskTop = WSHShell.SpecialFolders("Desktop")
strFileList = DeskTop & "\" & "images.txt"
' File Extension type
strExt = InputBox("Please enter the File type" _
& vbcrlf & "For Example: jpg or tif")
If strExt="" Then
WScript.Echo "Invalid Input, Script Canceled"
Wscript.Quit
End if
' Get the source path for the copy operation.
Dim strSourceFolder
Set objFolder = objShell.BrowseForFolder(0, "Select source folder", 0 )
If objFolder Is Nothing Then Wscript.Quit
Set objFolderItem = objFolder.Self
strSourceFolder = objFolderItem.Path
' Get the target path for the copy operation.
Dim strTargetFolder
Set objFolder = objShell.BrowseForFolder(0, "Select target folder", 0 )
If objFolder Is Nothing Then Wscript.Quit
Set objFolderItem = objFolder.Self
strTargetFolder = objFolderItem.Path
Set objFileList = objFSO.OpenTextFile(strFileList, ForReading, False)
On Error Resume Next
Do Until objFileList.AtEndOfStream
' Read next line from file list and build filepaths
strFileToCopy = objFileList.Readline & "." & strExt
' Check for files in SubFolders
For Each strSubFolder in EnumFolder(strSourceFolder)
For Each strFileToCopy in oFSO.GetFolder(strSubFolder).Files
strSourceFilePath = objFSO.BuildPath(strSubFolder, strFileToCopy)
strTargetFilePath = objFSO.BuildPath(strTargetFolder, strFileToCopy)
' Copy file to specified target folder.
Err.Clear
objFSO.CopyFile strSourceFilePath, strTargetFilePath, blnOverwrite
If Err.Number = 0 Then
' File copied successfully
iSuccess = iSuccess + 1
If Instr(1, Wscript.Fullname, "cscript.exe", 1) > 0 Then
' Running cscript, output text to screen
Wscript.Echo strFileToCopy & " copied successfully"
End If
Else
' Error copying file
iFailure = iFailure + 1
TextOut "Error " & Err.Number & _
" (" & Err.Description & ")trying to copy " & strFileToCopy
End If
Next
Next
Loop
strResults = strResults + 0 '& vbCrLf
strResults = strResults & iSuccess & " files copied successfully." & vbCrLf
strResults = strResults & iFailure & " files generated errors" & vbCrLf
Wscript.Echo strResults
Sub TextOut(strText)
If Instr(1, Wscript.Fullname, "cscript.exe", 1) > 0 Then
' Running cscript, use direct output
Wscript.Echo strText
Else
strResults = strResults & strText & vbCrLf
End If
End Sub
Function EnumFolder(ByRef vFolder)
Dim oFSO, oFolder, sFldr, oFldr
Set oFSO = CreateObject("Scripting.FileSystemObject")
If Not IsArray(vFolder) Then
If Not oFSO.FolderExists(vFolder) Then Exit Function
sFldr = vFolder
ReDim vFolder(0)
vFolder(0) = oFSO.GetFolder(sFldr).Path
Else sFldr = vFolder(UBound(vFolder))
End If
Set oFolder = oFSO.GetFolder(sFldr)
For Each oFldr in oFolder.Subfolders
ReDim Preserve vFolder(UBound(vFolder) + 1)
vFolder(UBound(vFolder)) = oFldr.Path
EnumFolder vFolder
Next
EnumFolder = vFolder
End Function
[/code]
Maybe you are looking for
-
New GL activated without data migration
Hi all, we have some three projects lined up, one of it is new gl, due to some reasons we have postponed the go live of new gl but other two projects wants to go ahead with their go live, so we provided them an environment where new gl is active but
-
I have a panel class with a slider on it . pseudocode: public class MyJSlider extends JPanel{ private JSlider myjslider; private Color mycolor; public Color getColor(){return mycolor;} the action taken by the JSlider is to set mycolor to a new Color(
-
Increase the partition size in red hat
Hello, I want to increase Linux red hat (root) partition.how can i do this.I am very thankful to you Regards, Umair
-
Changing AHCI interface to RAID without reformat
I've read many places that you cannot change your hard drive interface to run in RAID after already installing Windows 7 in IDE or AHCI format without having to erase everything and reformat Windows - however Gigabyte's motherboard has a 3 click fea
-
I recently installed snow leopard on my macbook (mid 2006). I used system preferences to set the snow leopard boot disc as the install disc, and now my computer won't boot. It stalls at the apple icon with the grey screen. Is there any way I can set