Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
Running Windows on your Mac
Applescript - changing the extension of files
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="origami" data-source="post: 349467" data-attributes="member: 20108"><p>I tried that before, and here is what I got as an error</p><p></p><p>tell current application</p><p> choose folder with prompt "Select folder to rename files in:"</p><p> alias "Hard Drive::new:"</p><p> display dialog "Extension to Replace:" default answer ""</p><p> {text returned:"abc", button returned:"OK"}</p><p> display dialog "Replace With:" default answer ""</p><p> {text returned:"xyz", button returned:"OK"}</p><p>end tell</p><p>tell application "Finder"</p><p> get every file of alias "Hard Drive:new:" whose name ends with "abc"</p><p> {alias "Hard Drive:new: ssscon08.abc"}</p><p> select file (alias "Hard Drive:new: ssscon08.abc")</p><p> document file " ssscon08.abc" of folder "new" of startup disk</p><p> get name of alias "Hard Drive:new: ssscon08.abc”</p><p> " ssscon08.abc”</p><p> offset of "abc" in " ssscon08.abc"</p><p> 15</p><p> set name of selection to "ssscon08.xyz"</p><p> "Finder got an error: Can't set name of selection to \" ssscon08.xyz\"."</p></blockquote><p></p>
[QUOTE="origami, post: 349467, member: 20108"] I tried that before, and here is what I got as an error tell current application choose folder with prompt "Select folder to rename files in:" alias "Hard Drive::new:" display dialog "Extension to Replace:" default answer "" {text returned:"abc", button returned:"OK"} display dialog "Replace With:" default answer "" {text returned:"xyz", button returned:"OK"} end tell tell application "Finder" get every file of alias "Hard Drive:new:" whose name ends with "abc" {alias "Hard Drive:new: ssscon08.abc"} select file (alias "Hard Drive:new: ssscon08.abc") document file " ssscon08.abc" of folder "new" of startup disk get name of alias "Hard Drive:new: ssscon08.abc” " ssscon08.abc” offset of "abc" in " ssscon08.abc" 15 set name of selection to "ssscon08.xyz" "Finder got an error: Can't set name of selection to \" ssscon08.xyz\"." [/QUOTE]
Verification
Post reply
Forums
Apple Computing Products:
Running Windows on your Mac
Applescript - changing the extension of files
Top