Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try:</p> <pre><code>tell application "Finder" to set desktopFolder to (path to desktop folder as text) &amp; "Temp Export From DO" as alias tell application "System Events" to set theDOEntries to every file of folder "/Users/jkratz/Dropbox/Apps/Day One/Journal.dayone/entries" whose name extension is "doentry" repeat with DOEntry in theDOEntries log "Source file: " &amp; DOEntry log "Destination folder: " &amp; desktopFolder tell application "Finder" to duplicate file DOEntry to desktopFolder with replacing end repeat </code></pre> <p>If you don't need to log the values you can simply:</p> <pre><code>tell application "Finder" to set desktopFolder to (path to desktop folder as text) &amp; "Temp Export From DO" as alias tell application "System Events" to set theDOEntries to every file of folder "/Users/jkratz/Dropbox/Apps/Day One/Journal.dayone/entries" whose name extension is "doentry" tell application "Finder" to duplicate theDOEntries to desktopFolder with replacing </code></pre> <p>Or:</p> <pre><code>set desktopFolder to quoted form of (POSIX path of (path to desktop folder as text) &amp; "Temp Export From DO") do shell script "find '/Users/jkratz/Dropbox/Apps/Day One/Journal.dayone/entries' -name \"*.doentry\" -type f -print0 | xargs -0 -I {} cp -a {} " &amp; desktopFolder </code></pre> <p>Getting back to your question, the duplicate commands creates duplicates of Finder items. You can use System Events to duplicate Finder items like this:</p> <pre><code>tell application "Finder" set myFile to file ((path to desktop as text) &amp; "Test File.txt") set myFolder to folder ((path to desktop as text) &amp; "Test Folder") end tell tell application "System Events" duplicate myFile to myFolder end tell </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload