Thursday, April 18, 2024
HomeAppleapplescript - Need assistance w Apple Script studying textual content and copying...

applescript – Need assistance w Apple Script studying textual content and copying information to new folder


I am needing assist with an AppleScript I have been utilizing. The present script I exploit reads a textual content file that incorporates pdf file names, after which strikes these to a special folder. This one works nicely however I actually need it to simply copy them as an alternative of transferring them. May anybody probably assist with that?

# folders on completely different gadgets
set path2source to decide on folder with immediate "Choose the supply folder" default location (path to desktop)
set path2dest to decide on folder with immediate "Choose the vacation spot folder" default location (path to desktop)
set path2list to decide on file with immediate "Choose your textList" of kind {"txt"}

set theList to paragraphs of (learn path2list)

inform utility "System Occasions"
    set theFiles to path of information of path2source
    set sourceList to {}
    repeat with aFile in theFiles
        if (title of disk merchandise aFile) is in theList then
            set finish of sourceList to my quotedIt(aFile)
        finish if
    finish repeat
finish inform

do shell script "mv " & my recolle(sourceList, house) & house & quoted type of POSIX path of path2dest

#=====

on quotedIt(aFile)
    return quoted type of POSIX path of aFile
finish quotedIt

#=====

on recolle(l, d)
    native oTIDs, t
    set {oTIDs, AppleScript's textual content merchandise delimiters} to {AppleScript's textual content merchandise delimiters, d}
    set t to l as textual content
    set AppleScript's textual content merchandise delimiters to oTIDs
    return t
finish recolle

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments