Automator Script to rename files with the file's Comment text?
Hello and thank you for your time!
Summary:
I'd like to have an Automator Script that would copy the File's Comment info and paste it to the File's name, so I can import my sound effects into iTunes and have the proper labeling.
Breakdown:
I have a ton of Sound Effects that I'd like to put into iTunes, but the filenames are for example, "04. Track 04.mp3". Not the most helpful name.
I can search by "car crash" in the finder and find THAT file ("04. Track...") because it's in the File's metadata in the Comment info, as "Car Crash - Chevy Camaro".
So is there a script or a way to script Automator to copy the File's Comment info and paste it to the File's name, so I can import these into iTunes and have the proper labeling?
Thank you for reading!
- Ben
This should be much faster and direct....
Source = "C:\temp"
Destination "C:\newTemp"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set arrFiles = objFSO.GetFolder(Source).Files
For Each file In arrFiles
If InStr(LCase(file.name), ".zip.") > 0 Then
arrFilename = Split(lcase(file.name), ".zip.")
newname = arrFilename(0) & ".zip"
WScript.Echo file.name & " -> " & newname
objFSO.CopyFile file.path, Destination & "\" & newname
End If
Next
Similar Messages
-
To download the GL 140881 with the colums VENDOR CODE & TEXT in FBL3N
Hello Exports
My user trying to download the GL 140881 with the colums VENDOR CODE & TEXT in FBL3N
In the columm of Vendor code and Text he wants to Display in the respective filed
before that he has done transaction IN MIRO
The Entry is
PK Account Account short text Tx Cost Ctr Order Amount
31 35774 FRICTION ENGINEERS 4I 30.375,00
86 310891 GR-IR clear-RM/Comp 4I 13.500,00
86 310891 GR-IR clear-RM/Comp 4I 13.500,00
40 140881 VAT RECOVERABLE 4I 1.687,50
40 140881 VAT RECOVERABLE 4I 1.687,50
in this he wants disply VENDOR CODE & TEXT in FBL3N for 140881 G/L A/C (VAT RECOVERABLE )
But i tryed it by table wise like BSEG and LIFNR but its displys only filed name but it not displaying the VENDOR CODE & TEXT in the respective filed
Can you please give suggesstion on the same
Thanks and Regards
vamsiDear,
Check the following ink -
Re: Vendor & Customers in FBL3N
regards,
Gov -
To download the GL 140881 with the colums VENDOR CODE & TEXT in FBL3N Pos
Hello Exports
My user trying to download the GL 140881 with the colums VENDOR CODE & TEXT in FBL3N
In the columm of Vendor code and Text he wants to Display in the respective filed
before that he has done transaction IN MIRO
The Entry is
PK Account Account short text Tx Cost Ctr Order Amount
31 35774 FRICTION ENGINEERS 4I 30.375,0086
310891 GR-IR clear-RM/Comp 4I 13.500,0086
310891 GR-IR clear-RM/Comp 4I 13.500,0040
140881 VAT RECOVERABLE 4I 1.687,5040
140881 VAT RECOVERABLE 4I 1.687,50
In this he wants disply VENDOR CODE & TEXT in FBL3N for 140881 G/L A/C (VAT RECOVERABLE )
But i tryed it by table wise like BSEG and LIFNR but its displys only filed name but it not displaying the VENDOR CODE & TEXT in the respective filed
Can you please give suggesstion on the same
Thanks and Regards
vamsiyes i got a solution
Thanks for all
vamsi -
Automator/Applescript to Rename files when dropped in folder based on parent folder name
When a file is dropped in a folder ( ParentFolder/Folder/File.pdf )
I want to rename the file to ParentFolder_Folder_01.pdf
--Get folder
--Get ParentFolder
--Check for next available number and use it.
If ParentFolder_Folder_01.pdf exists, try _02
I automator, I have chosen folder action
Added 'Get selected finder items'
I have attempted to modify another sript I found here to no avail.
on run {input, parameters}
tell application "Finder"
set theFolder to input as string
set theNameOfFolder to name of folder theFolder
set theFiles to every file in folder theFolder
set theFolders to every folder in folder theFolder
my ProcessFiles(theNameOfFolder, theFiles)
my ProcessFolders(theFolders)
end tell
end run
to ProcessFolders(theFolders)
tell application "Finder"
repeat with thisFolder in theFolders
set theNameOfFolder to name of thisFolder
set theFiles to every file in thisFolder
set theFolders to every folder in thisFolder
my ProcessFiles(theNameOfFolder, theFiles)
my ProcessFolders(thisFolder)
end repeat
end tell
end ProcessFolders
to ProcessFiles(NameOfOuterFolder, theFiles)
tell application "Finder"
repeat with thisFile in theFiles
set theSuffix to my grabSuffixOfFile(name of thisFile)
set name of thisFile to NameOfOuterFolder & "_" & theSuffix
end repeat
end tell
end ProcessFiles
to grabSuffixOfFile(theFile)
set text item delimiters to "_"
return (text item 2 of theFile)
set text item delimiters to ""
end grabSuffixOfFileNormally it is a bad idea to do things with items that are in the attached folder (earlier OS versions will retrigger folder actions when an item is renamed, for example), and you don't need to use a Get Selected Finder Items action since the dropped items are already passed to your workflow (also note that the input items will be a list).
It looks like you are trying to use multiple passes to add on the folder names, but you will have less of a headache if you build the base name and just deal with the number suffix. If I understood your naming scheme correctly, the following script should do the trick - it isn't very fast, but should be OK for a few items at a time.
on run {input, parameters} -- rename input Finder items (aliases) to name of containing folders
set divider to "_" -- the divider character between name pieces
set output to {} -- the result to pass on to the next action
set counter to "01" -- start suffix at one
repeat with anItem in the input -- step through each item in the input
set anItem to contents of anItem -- dereference
tell application "Finder" to if class of item anItem is document file then -- don't mess with folders or applications
set {itemParent, itemExtension} to {container, name extension} of anItem
if itemExtension is not "" then set itemExtension to "." & itemExtension
set grandParentName to name of container of itemParent
set parentName to name of itemParent
set newName to grandParentName & divider & parentName & divider & counter
set documentNames to my getExistingNames(itemParent)
repeat while newName is in documentNames -- increment counter suffix as needed
set counter to text -2 thru -1 of ("0" & (counter + 1))
set newName to grandParentName & divider & parentName & divider & counter
end repeat
set name of anItem to (newName & itemExtension)
set end of output to anItem -- alias still refers to the same file even after renaming
end if
end repeat
return the output
end run
to getExistingNames(someFolder) -- get base document names (no extensions) from a folder
set nameList to {}
tell application "Finder" to repeat with aFile in (get document files of someFolder)
set {fileName, fileExtension} to {name, name extension} of aFile
if fileExtension is not "" then set fileExtension to "." & fileExtension
set fileName to text 1 thru -((count fileExtension) + 1) of fileName -- just the name part
set end of nameList to fileName
end repeat
return nameList
end getExistingNames -
Automator: Impossible to rename file using automator under Mac OS X Lion
Hi,
Before upgrade my iMac to MAC OS X Lion 10.7.2, I had service created with automator under snow leopard in order to rename my pictures file names by blocks instead of one by one. Since I'm using Lion, this one doesn't work anymore. I have completely recreate the service under Lion and the results is the same.
You can find below my workflow that is easy. The problem is the message error in the history of automator application. The message is "impossible to rename file "file name" because this one should create conflict with existing file". I already test a lot of times with different name where I'm sure that this one doesn't exist on my Mac but all the time without success (verify also with search function under mac)
If somebody can help me, it would be very interesting because I already tried to find answer on internet without success too.
Thanks in advance for your help.the whole automator and in particular the record action was substantially rewritten in snow leopard. and the record action is slow, unreliable and you can't trouble-shoot it. it's a wonder it works at all. the only advice i can give is to use it as little as possible. if at all possible avoid it altogether. if you do need to use it try using keyboard strokes instead of the mouse movement. for example. use command+c and command+v for copying and pasting and use tabbing to choose the correct box on the page.
-
Trigger automator script when new file created
I want to create an automator script that will recognise when a new file is created (with a name that matches a particular pattern and in a certain directory) and mail that file to a predefined address. Is that possible?
yes, this is possible with a folder action. you can attach a folder action to the folder in question. it will watch this folder for new files and trigger when a new file is added. you can create an automator workflow and save it as a folder action plugin.
-
Automated script to load files
Hi ,
i have a procudure (pl/Sql) that loads a dat files to oracle tables, taking a file name as input parameter.
i manually execute this pl/sql on daily basis which usually takes 30 min for one file.
but now due to some issue in data i will have to truncate all the tables this procudes load as reload the data,there are nearly 100 files which i have to run,
the files should be processed one after the other in a order.
can any one suggest how can i automate this process.
i just wanna load 10 files at a time.
Meaning, a script to supply files names to this pl/sql and return the log
thanks.simply use a date instead of a number.
SQL> begin
2 for i in ( select dt from ( select sysdate+level dt from dual
3 connect by level <= 10 ) ) loop
4 dbms_output.put_line(to_char(i.dt,'ddmmyyyy')||'_DSW');
5 end loop;
6 end;
7 /
13052008_DSW
14052008_DSW
15052008_DSW
16052008_DSW
17052008_DSW
18052008_DSW
19052008_DSW
20052008_DSW
21052008_DSW
22052008_DSW
PL/SQL procedure successfully completed.
SQL>
in your case you need to identify what is the starting date. replace the sysdate with that starting date and the level identifier from 10 to 100. assuming that in your given example it starts at 05062007.
begin
for i in ( select dt from ( select to_date('05-JUN-2007','dd-mon-yyyy')+level dt from dual
connect by level <= 100 ) ) loop
dbms_output.put_line(to_char(i.dt,'ddmmyyyy')||'_DSW');
procedure_load_file(to_char(i.dt,'ddmmyyyy')||'_DSW');
end loop;
end; -
PS Script To Rename File Using CSV - Filename Is Containing IP Address And Needs To Be Host Name
Hello All,
I am currently working with PDF reports which are named "TEMXX.XX.XXX.XX_141215.pdf", XX.XX.XXX.XX is an IP address. I have created a CSV which contains two columns, ColumnA = IPAddress ColumnB = HostName. I would like to remove the existing title
of the file, and rename it as "ColumnB.pdf".
The only two commands which come to mind are:
get-childitem *.pdf | foreach { rename-item $_ $_.Name.Replace("TEM", "") }
get-childitem *.pdf | foreach { rename-item $_ $_.Name.Replace("_141215", "") }
The above commands are of course to remove the unwanted "TEM" and "_141215" but I cannot seem to figure out how to just rename files as ColumnB.pdf.
Any help would be greatly appreciated :).Hello All,
I performed the following but it did not execute, just returned the prompt. The final ps1 file was saved and ran as follows:
$lines = Import-Csvservers.csv
ForEach($line in $lines){
get-childitem *.pdf |where {$_.name -eq $line.ColumnA}|Rename-Item -NewName $line.ColumnB
CSV file named servers.csv displayed as follows:
ColumnA,ColumnB
192.168.1.2,SERVER1
192.168.1.3,SERVER2
Files in Explorer displayed as follows:
ray192.168.1.2_2015.pdf
ray192.168.1.3_2015.pdf
As indicated above the filename should be finalized as:
SERVER1.pdf
SERVER2.pdf
Any help in figuring this out would be greatly appreciated. -
Applescript or workflow to extract text from PDF and rename PDF with the results
Hi Everyone,
I get supplied hundreds of PDFs which each contain a stock code, but the PDFs themselves are not named consistantly, or they are supplied as multi-page PDFs.
What I need to do is name each PDF with the code which is in the text on the PDF.
It would work like this in an ideal world:
1. Split PDF into single pages
2. Extract text from PDF
3. Rename PDF using the extracted text
I'm struggling with part 3!
I can get a textfile with just the code (using a call to BBEDIT I'm extracting the code)
I did think about using a variable for the name, but the rename functions doesn't let me use variables.Hello
You may also try the following applescript script, which is a wrapper of rubycocoa script. It will ask you choose source pdf files and destination directory. Then it will scan text of each page of pdf files for the predefined pattern and save the page as new pdf file with the name as extracted by the pattern in the destination directory. Those pages which do not contain string matching the pattern are ignored. (Ignored pages, if any, are reported in the result of script.)
Currently the regex pattern is set to:
/HB-.._[0-9]{6}/
which means HB- followed by two characters and _ and 6 digits.
Minimally tested under 10.6.8.
Hope this may help,
H
_main()
on _main()
script o
property aa : choose file with prompt ("Choose pdf files.") of type {"com.adobe.pdf"} ¬
default location (path to desktop) with multiple selections allowed
set my aa's beginning to choose folder with prompt ("Choose destination folder.") ¬
default location (path to desktop)
set args to ""
repeat with a in my aa
set args to args & a's POSIX path's quoted form & space
end repeat
considering numeric strings
if (system info)'s system version < "10.9" then
set ruby to "/usr/bin/ruby"
else
set ruby to "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby"
end if
end considering
do shell script ruby & " <<'EOF' - " & args & "
require 'osx/cocoa'
include OSX
require_framework 'PDFKit'
outdir = ARGV.shift.chomp('/')
ARGV.select {|f| f =~ /\\.pdf$/i }.each do |f|
url = NSURL.fileURLWithPath(f)
doc = PDFDocument.alloc.initWithURL(url)
path = doc.documentURL.path
pcnt = doc.pageCount
(0 .. (pcnt - 1)).each do |i|
page = doc.pageAtIndex(i)
page.string.to_s =~ /HB-.._[0-9]{6}/
name = $&
unless name
puts \"no matching string in page #{i + 1} of #{path}\"
next # ignore this page
end
doc1 = PDFDocument.alloc.initWithData(page.dataRepresentation) # doc for this page
unless doc1.writeToFile(\"#{outdir}/#{name}.pdf\")
puts \"failed to save page #{i + 1} of #{path}\"
end
end
end
EOF"
end script
tell o to run
end _main -
Can a Button call a java script and then proceed with the creation
Hi all,
I have a simple APEX form on a table,
with simple function as create and apply changes,
some items of the form are computed by a "Computation"
I need the create button to show the computed values, before move to the next page, then proceed with the creation ( submission)
I have tried to show the values by a java script, but after clicking the button OK of the javascript msg, no submission performed ,
details:
the java script is called in the URL of the Button,
it only contains a alert statement
is there a way to let the button do that
or may be the case could be solved by another idea!!!
rgrds,Hi Varad,
It is Before header of course. I forgot to mention this.
Yes, you are right Varad, I have read again the question and seems original request was to show Computation that is done in After Submit, more javascript is required of course.
One possibility is to create On Demand process called COMPUTEITEM where you compute your item, and in the end of on demand process it prints it
htp.p(:P1_X)
Then put in HTML header of your page
<script language="JavaScript" type="text/javascript">
function setShowItemSub(pThis){
var l_This = $x(pThis);
var ajaxRequest = new htmldb_Get(null, $v('pFlowId'), 'APPLICATION_PROCESS=COMPUTEITEM', $v('pFlowStepId'));
ajaxRequest.add($x(l_This).id, $v(l_This));
var gReturn = ajaxRequest.get();
alert(gReturn);
ajaxRequest = null;
doSubmit('aa');
</script>And in Button URL textarea put:
javascript:setShowItemSub('P1_X');
Then no need in After Submit process anymore
I have put this now in http://apex6.revion.com/pls/apex/f?p=225:1
COMPUTEITEM On demand process is :
:P1_X := :P1_X || ' Added this trail';
htp.p(:P1_X);Of course, all this should be modified accordingly
Regards,
Oleg -
Keeping a logo inline with the end of a text layer
How do I anchor or parent another layer to the end of a text box? For example, I want have a logo at the end of a text layer saying "Weeknights" and have the position of the logo automatically adjust when I change the text to something shorter or longer such as "Tonight" (I cannot right justify the text as I need to have the front of it line up with something else)
Since you say NOTHING about air times, this gets pretty easy:
Weeknights
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Tomorrow
Tonight
What is that, nine variations? That's ALL?
And you want a fancy expression for it? How long can it take to make all nine: an hour if you're drunk, sleep-deprived and crippled, perhaps?
I think you're looking for a complicated solution where none is necessary. -
There is a problem with the galaxy s3 showing text on vz e-mail
When you receive an e-mail in the Vz account sometimes the text is missing. Support and technical suggest that I forward the e-mail to a Gmail account where I can see the whole document. They are aware of the problem and suggest to wait to October where they expect an update. They should never had release the instrument since Samsung tells me that the problem is with the Vz synchronization. I will like to know if other people have the same problem or I have a defective unit. After all the calls and getting different answers I don't trust Vz anymore..
- Try another cable.
- Try another charging source
- Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
- Make an appointment at the Genius Bar of an Apple store. You can still go if your country has Genius Bars
Apple Retail Store - Genius Bar -
HT6030 Issues with the Mavericks Mail's text-decoding
Hey guys! I'm an OS X user, i updated it to the Mavericks, and i have one question. I can't find the e-mail's text-decoding possibilities in the Mavericks Mail program. I tried to find this in the Mail's Help, but it is trying to navigate me a not existing tab. I searched it everywhere in the menu-system, but no success.
Thanks in advance!Unfortunately there are numerous threads about problems with Yahoo rejecting passwords with no definite solution, but it seems to be a Yahoo problem. Here's one:
https://discussions.apple.com/thread/3804431
I did spot that Gtj56 in this thread found that changing the password so it had no capital letters fixed it for him and someone else. Don't know whether this will help you:
https://discussions.apple.com/thread/3800540 -
Where is the Infotype 0035 comment text stored
Where are the comments text field on infotype 0035 stored?
Please create report "" via SE38 and . With the report you can list all texts
from PCL1, cluster TX that exits for several personnel numbers and a
specific infotype. -
Script to send email with the filename of the file just added to a folder?
Hi,
I have an AppleScript set into an Automator workflow which will send me an email when a file is added to a folder.
What I would like to have happen though is have the email include the file name of the file that is added to the folder
tell application "Mail"
set theNewMessage to make new outgoing message with properties {subject:"New File added", content:"File", visible:true}
tell theNewMessage
make new to recipient at end of to recipients with properties {address:"[email protected]"}
send
end tell
end tell
I'm new at the whole AppleScript thing, but I'm getting how powerful it can be.
Thanks for any help.Maybe something along these lines...
*set theBody to text returned of (display dialog "Enter message text here " default answer "")*
*set theSubject to text returned of (display dialog "Enter subject here " default answer "")*
*set theTarget to text returned of (display dialog "Enter recipient's email address here " default answer "")*
*tell application "Mail"*
*set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody}*
*tell newMessage*
*make new to recipient at end of to recipients with properties {address:theTarget}*
*set sender to "[email protected]"*
*end tell*
*send newMessage*
*end tell*
Regards, Andrew99
Maybe you are looking for
-
Ipod not showing up on itunes or computer when plugged in
Trying to sync my ipod touch, but when I plug it in it doesn't show up on my itunes or on my laptop, a prompt just comes up saying something about the camera. I have windows 8. I need help, I don't know how to fix this problem by myself. I also have
-
What are the transactions we use day to day in the bw before go live
what are the transactions we use most in the bw before go live? Tcodes for backend objects like creating infocube and so on. Tcodes for front end objects like creating queries and so on. Thank you. York
-
Palm TX on 64-bit Windows 7 ???
For years I had Palm TX with tons of data synchronizing with Windows XP running 4.1.4 Palm desktop software. Just bought new laptop running 64-bit Windows 7. Tried to install Palm Desktop 6.2 -- no luck! Installation encounters error and does not
-
Importing existing classes loses package identity in 9.0.2
I have tried several ways, but everytime I import existing classes, they all go to Miscellaneous Files and won't display under their packages. This is from disk or from source code control (CVS). This works fine with the same exact classes and direct
-
Import configuration and ICM scripts into ICM 7.5X
Hi all. I just want to find out if it is possible to export configuration & ICM routing/ Admin scripts from ICM 6.0 into ICM 7.5X? I understand that there is an import/export function in the ICM script editor. Can I just export the scripts from ICM s