applescript help move files after converting.

Discussion in 'AppleScript' started by aaabha, Mar 14, 2011.

  1. aaabha

    aaabha New Member

    Joined:
    Jun 26, 2010
    Messages:
    24
    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
    .
     
    aaabha, Mar 14, 2011
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. zeyhra

    Applescript to stuff and move files

    zeyhra, Jun 12, 2006, in forum: AppleScript
    Replies:
    3
    Views:
    8,247
    zeyhra
    Aug 10, 2006
  2. polites
    Replies:
    0
    Views:
    2,899
    polites
    Mar 19, 2007
  3. appatight

    Applescript to delete and move files

    appatight, Mar 9, 2011, in forum: AppleScript
    Replies:
    0
    Views:
    2,688
    appatight
    Mar 9, 2011
  4. Otto van Verseveld
    Replies:
    5
    Views:
    568
    Otto van Verseveld
    Apr 8, 2008
  5. Edward Mendelson
    Replies:
    0
    Views:
    408
    Edward Mendelson
    Feb 23, 2004
  6. Michael H. Phillips

    Converting Applescript to Javascript

    Michael H. Phillips, Jul 15, 2008, in forum: UK Macs
    Replies:
    7
    Views:
    1,916
    Chris Ridd
    Jul 15, 2008
  7. musicsteve
    Replies:
    1
    Views:
    1,064
    Spawn_Dooley
    May 12, 2012
  8. Praveen

    Converting .pcx files to .jpeg files

    Praveen, Apr 9, 2014, in forum: AppleScript
    Replies:
    4
    Views:
    611
    Cory Cooper
    Apr 10, 2014
Loading...