Mac Help Forums


Reply
Thread Tools Display Modes

applescript help move files after converting.

 
Member
Join Date: Jun 2010
Posts: 24
 
      14th March 2011
Good Day!

I quite a newbie in applescripting... I have created a script that resaves a .tif file into .eps using illustrator 10. What I want is the user will select the tiff original folder and the eps destination folder... it selects all the tif files in the original folder open it in illustrator resaves it into eps and move that eps to the destination folder. On my script the eps file staying on the original folder.


Code:
set the topLevelFolder to choose folder with prompt "Source Folder?" as string
tell application "Finder"
set AllFiles to name of every file of folder topLevelFolder as list
end tell

set myPath to choose folder with prompt "Destination folder?" as string

tell application "Finder" to set fileName to AllFiles

tell application "Adobe Illustrator 10"
repeat with i in AllFiles
set OpenThisDoc to ((topLevelFolder as string) & i) as alias
open OpenThisDoc
if (count of documents) > 0 then
set myInteractLevel to user interaction level
set user interaction level to never interact
set myPath to file path of document 1 as string
if myPath ends with ".tif" then
try
repeat with myPage from 1 to 1
open alias myPath with options {page:myPage}
set myNewPath to myPath
repeat with myCharNum from (count of characters of myNewPath) to 1 by -1
if character myCharNum of myNewPath = "." then
if myCharNum > (count of characters of myNewPath) - 5 then set myNewPath to (text of characters 1 thru (myCharNum - 1) of myNewPath) as string
exit repeat
end if
end repeat
set myNewPath to myNewPath & ".eps"
save document 1 in file myPath as eps
close document 1 saving no
end repeat
end try
end if
set user interaction level to myInteractLevel
end if
end repeat
end tell
thanks in advance

Regards,
Polites
.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Applescript to delete and move files appatight AppleScript 0 9th March 2011 09:46 PM
Converting Applescript to Javascript Michael H. Phillips UK Macs 7 15th July 2008 06:33 PM
applescript help move files after converting polites AppleScript 0 19th March 2007 09:08 AM
Applescript to stuff and move files zeyhra AppleScript 3 10th August 2006 08:58 PM
AppleScript to move or hide OS X dock when specific app in foreground? Edward Mendelson AppleScript 0 23rd February 2004 01:01 AM


All times are GMT +1. The time now is 08:35 PM.
Mac-Help.com is an independent website and is not affiliated with Apple Inc.


Welcome!
Welcome to the Mac Help Forums
 


Latest Threads
MacBook
basil422 (2 Hours Ago, 06:01 PM)

Outlook reminders not popping up
WonderBot (3 Hours Ago, 05:03 PM)

Help with Windows 7
Kjerste (8 Hours Ago, 12:32 PM)

NO Sound - no input or output devices found
osxlion (19 Hours Ago, 12:58 AM)

Using Terminal to move my iTunes and GarageBand libraries to an external?
corbytender (21 Hours Ago, 10:51 PM)

 


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51