So the Excel window shows up as it should â and the macro should work no matter what screen you have the rename workbook on.
With one caveat â when AppleScripting apps it can be problematic if any of their windows are in full-screen mode.
This new macro locks in the rename workbooks name which must be:
â â â File Rename Template.xlsx
When you import it it will be in macro group: Test Group.ccstone â you may move that wherever you want, although I would usually run this type of thing in the context of the Finder.
I have now received the Excel sheet and the files to be renamed. I have copied both columns from the Excel sheet and pasted them into your File Rename Template.
Unfortunately I now get the following error message.
Strangely enough, the macro no longer works with the test setting, too.
âFinderâ hat einen Fehler erhalten: âalias "Macintosh HD:Users:MatzesMini:Documents:FSD DatensaĚtze:1.pdf"â kann nicht als â"Kroell_1.pdf"â gesetzt werden.
The values in the first column are entered into Excel as numbers rather than text, which is why it is returning 3.0 rather than "3". They'll have to be changed to text, either in Excel or in the AppleScript.
Given that you don't have the ".pdf" appended to the "Old File Name" values either, the simplest solution is another column in Excel that concats column A values with ".pdf" to give you your "proper" values -- but that does mean another column to handle in Chris's script (unless you eg do the concatenation, copy the values, paste them over column A, then delete the concat column).
Doesn't work how? Still throwing the Unicode error, or do you mean the Finder error you last reported?
If it's the Finder error -- is the "old" file present? Can you change the name manually (ie check you have permission to change and that the file isn't locked, or maybe open in another program)? Does the renamed version already exist?
You can't make changes willy-nilly to a system and expect things to continue work properly.
When you changed the file name convention in column one from â1.pdfâ to â1â (Number.Suffix to Number) the AppleScript pulled real number values for those items instead of text.
I have updated the script in Post #28 to version 1.51 to forcefully pull string values for the column one items.
BUT â the script is designed to work with Number.Suffix formatted file names in column one.
By happenstance â when I changed value to string value the script actually does work with numerical values only in column one (i.e. without the file suffix .pdf) â but that's just dumb luck.
The devil is in the details, and changing details without understanding exactly what you're doing will often get you burned.
I will post a macro soon that is a complete one to one name swap â OldName to NewName.
Tell us your complete workflow along with your end-objective up front â ==do not spoon-feed it to us one post at a time== -- i.e. don't waste your time or ours.
Tinkering with scripts and macros is how we learn â but when you're in the midst of getting help it can be very detrimental when you've tinkered with something and not communicated that clearly to those helping.
This gets very confusing for everyone, and it tends to burn a lot of time.
There's a reason they teach communications courses at University...