Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Hardcoding the "Aperture Hot Folder" script variables

Hello,


I use the Aperture Hot Folder script to monitor a folder on my desktop that I drop images into from my phone. I would like to have the script running all of the time, but I don't want it to ask me for any input when it runs ... I want to have the variables hard coded right into it so that I can launch it at start up and not have to think about it.


This is what it does out of the box:


  1. Welcome dialog
  2. Asks for the folder to be monitored
  3. Asks for the project to import to
  4. Asks if the files should be in the Library or be referenced
  5. Lets you know that it's all set up and ready to go.


What I would like it to do is simply launch without prompting for any input or showing any dialogs other than the 'are you sure you want to quit' bit when you quit the script.


I have no scripting experience at all, but in my initial poking around I have gotten to this point easily enough:


  1. Skips the welcome dialog
  2. The hot folder is predefined in the script so this dialog is now skipped
  3. Asks for the project to import to (this is the part I need help with)
  4. This is predefined as Referenced in the script so this dialog is now skipped
  5. I've removed the entire 'confirmation' section, yet it seems to come back on it's own, so I need help with that too.



Item #3 that I need help with:


tell application "Aperture"

activate

my generate_projectlist()

set this_path to (choose from list project_paths) as Unicode text

if this_path is "false" then tell me to quit

repeat with i from 1 to the count of project_paths

if this_path is (item i of the project_paths) then

set the project_ID to (item i of the project_IDs)

exit repeat

end if

end repeat

end tell


It produces the list of my existing projects as it's supposed to, but I want to simply hard code the target project into the script here instead.


This is what I tried:


tell application "Aperture"

activate

set the project_ID to "Incoming"

end tell


It skips the process of having me chose the project from a list, however, the script does not work in that files placed in the hot folder to not get imported. I'm assuming it's because I am using the wrong information in setting the variable. The Project is called "Incoming" in Aperture, but I don't know exactly how I should be stating that here.



Item #4 looks like this:


tell application "Aperture"

activate

display dialog "Setup is complete, this applet will stay open and running." & return & return & "To stop this script, make the script applet the frontmost application and choose “Quit” from its Application menu." with title "Setup Completion Dialog" with icon icon_file buttons {"OK"} default button 1 giving up after 15

end tell


I've tried removing it completely, but the confirmation dialog still shows up and when I go back into the script, the above code is somehow back in place.



Any help is greatly appreciated!


-Travis

Aperture 3, Mac OS X (10.7.3)

Posted on Mar 22, 2012 9:45 PM

Reply
Question marked as Best reply

Posted on Mar 22, 2012 10:11 PM

Hi Travis -- it's much easier than what you are doing. Just create a Folder Action that takes any file put in the specified Finder folder and makes Aperture import it. You specify the Project, and whether to import as Referenced or Managed (and if managed, whether to delete the original). If Aperture isn't running, it will be launched. Piece of cake.


  • Launch Automator.
  • Create a new Folder Action.
  • Save your Folder Action with a useful name (e.g.: "Auto-import into iPhone Project").
  • In the search field type "Aperture".
  • Drag the "Import" action to the workspace.
  • Select your settings.
  • Save your changes. Close Automator.


Try it out.


Screenshot:

User uploaded file

8 replies
Question marked as Best reply

Mar 22, 2012 10:11 PM in response to Doc.Caliban

Hi Travis -- it's much easier than what you are doing. Just create a Folder Action that takes any file put in the specified Finder folder and makes Aperture import it. You specify the Project, and whether to import as Referenced or Managed (and if managed, whether to delete the original). If Aperture isn't running, it will be launched. Piece of cake.


  • Launch Automator.
  • Create a new Folder Action.
  • Save your Folder Action with a useful name (e.g.: "Auto-import into iPhone Project").
  • In the search field type "Aperture".
  • Drag the "Import" action to the workspace.
  • Select your settings.
  • Save your changes. Close Automator.


Try it out.


Screenshot:

User uploaded file

Mar 23, 2012 9:27 AM in response to Doc.Caliban

Hm. No, I don't. I recall reading that these kinds of imports use the settings from the last import session, so it may be that you can affect how dupes are handled via the "Don't Import Dupes" checkbox on the import page.


Alternatively, if you import without any name change (which I think is the case here), you should be able to sort by name and quickly toss the dupes.


Even better -- set up a workflow by which you don't import dupes.


Sorry -- that's all I got.

Mar 23, 2012 8:38 PM in response to Kirby Krieger

Hello,


Well, after using this for the last day, I think I'd like to have another crack at the script method because of some shortcomings in the automator approach, the biggest one of which is that it gives focus to Aperture, which is on a different desktop, every time I drop a file into the automator folder, whereas the script doesn't even open an Aperture window at all ...


Could I still ask you to give me a hand with setting my target project in the script? Again, I think I just need to know what the syntax is for defining the project in this line:


set the project_ID to "Incoming"


I've managed to change everything else in the script to work with hard-coded variables.


Thanks again for the suggestions, and the time you've spent helping me!


-Travis

Mar 23, 2012 9:28 PM in response to Kirby Krieger

Ah, understood.


Where all of this came from is that I have a folder in which I dump all of the random images that I've saved on impulse from the web over the years, Shoe Box, which I keep in my Pictures folder and have a shortcut to on my desktop.


After years of feeding this folder, I decided to import it into Aperture where I have sorted it via keywords and smart albums. What I was doing was simply going into Aperture and doing an import every now and then, which worked just fine.


Then I got bored / geeky / curious and thought it might be cool to have the files automatically imported into the project the moment they hit the folder as I browse the web, thus the Hot Folder script.


That works fine, except then I got even nerdier and decided to hard code the variables so that I don't have to go through the setup every time I launch the script.


I'll re-post the question ... I tired to find where the script stores it's defined variables once I run the setup so that I can see what the correct format it for defining the path of the project, but was unable to do so. Someone must know!


-Travis

Hardcoding the "Aperture Hot Folder" script variables

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.