Hello,
I am trying to write a script that will create a folder called Babs JPEG Folder on my desktop, if it doesn’t exist…
This is what I have so far, but it doesn’t create the folder. It is part of a bigger project I am trying to figure out, one step at a time.
Can someone look at this and tell me what I am doing wrong?
property Babs_jpeg : "Babs JPEG Folder"
global deskPath2
global PathToFolder
global PathToFolder3
global temppdfs
on open thefiles
tell application "Finder"
activate
set temppdfs to (every item of (get selection)) -- MUST GET BEFORE MAKING FOLDERS
if not (exists folder Babs_jpeg) then make new folder with properties {name:Babs_jpeg}
set deskPath to desktop as text
set PathToFolder to POSIX path of (deskPath & Babs_jpeg)
set PathToFolder3 to deskPath2 & Babs_Folder & ":"
end tell
my openfiles()
say "Finished"
end open
I actually just got this far…and it makes the folder
Now I am trying to get Acrobat to open the PDF’s and save as jpegs.
I am plugging away here…
property Babs_jpeg : "Babs JPEG Folder"
global deskPath
global PathToFolder
global PathToFolder3
global temppdfs
on open thefiles
tell application "Finder"
activate
set temppdfs to (every item of (get selection)) -- MUST GET BEFORE MAKING FOLDERS
if not (exists folder Babs_jpeg) then make new folder with properties {name:Babs_jpeg}
set deskPath to desktop as text
set PathToFolder to POSIX path of (deskPath & Babs_jpeg)
set PathToFolder3 to deskPath & Babs_jpeg & ":"
end tell
my openfiles()
tell application "Adobe Acrobat Professional"
activate
end tell
say "Finished"
end open
Oh-I know why I can’t use that script as is…Right now, it saves the jpegs in the same folder and adds a “-0” , actually a sequential number based on the number of pages in the pdf file…My PDF’s would always be single page adds., and I want them to go into the “Babs jpeg folder” on the desktop, not add anything to the name. Also, being able to drag the entire folder onto that droplet, rather than, have to open it up and select the files, would also be a plus…
So, I will keep looking at that one and try to modify…
as mentioned above, the on open handler is triggered when files are dropped onto its icon.
To process the selected files use the on run handler.
This is an example to use run and open handler in one script
on run
tell application "Finder" to set theSelection to (get selection)
processFiles(theSelection)
end run
on open theItems
repeat with oneItem in theItems
tell application "Finder"
if class of oneItem is folder then
set theFiles to files of oneItem
my processFiles(theFiles)
end if
end tell
end repeat
end open
on processFiles(allFiles)
repeat with aFile in allFiles
-- do something
end repeat
end processFiles