controlling file download location

233 views
Skip to first unread message

hds17

unread,
Feb 17, 2012, 10:51:46 AM2/17/12
to Fake, mmit...@electrainfo.com
Hi,

Have a quesiton about how I can control where files get downloaded to
while using fake. I have many sites that I need to login, navigate
and then download daily reports. I'am wondering if there is a way to
control where files get downloaded to during each workflow? I would
like to have a different folder for each website I need to download
files from.

Regards,

Michael

Todd Ditchendorf

unread,
Feb 19, 2012, 12:08:48 PM2/19/12
to fak...@googlegroups.com, mmit...@electrainfo.com
Sorry, no. The only way to control download locations currently is in The General Preferences pane.

I'd like to add more features around downloads, but do not have a time frame for that currently.

TD

Todd Ditchendorf

unread,
Feb 19, 2012, 2:05:18 PM2/19/12
to Michael Mittiga, fak...@googlegroups.com
I would say try out the free demo from fakeapp.com and see if it meets your needs. 

Currently suffering from RSI from too much coding. So I'm not available for contract work. 

Sent from my iPhone

On Feb 19, 2012, at 10:45, Michael Mittiga <mmit...@electrainfo.com> wrote:

So would it be safe to say that Fake would not serve well in a daily production process where I need to download multiple transaction amd holdings files from 100+ websites daily? If we were willing to pay for some advances features is that something that would interest you guys? 

hds17

unread,
Feb 23, 2012, 11:59:00 AM2/23/12
to Fake
I have figured it out.

do shell script ("defaults write com.fakeapp.Fake FUDownloadDirPath /
Users/XXXXX/Desktop/CPB")
set path_ to "/Users/XXXXX/Desktop/" & "cpb.fakeworkflow"

tell application "Fake"
activate
open path_
delay 1
run workflow
end tell


Then I have fake quit at the end of the work flow.

However we would still like to have the ability to run multiple
sessions of fake at same time.


On Feb 19, 2:05 pm, Todd Ditchendorf <todd.ditchend...@gmail.com>
wrote:
> I would say try out the free demo from fakeapp.com and see if it meets your needs.
>
> Currently suffering from RSI from too much coding. So I'm not available for contract work.
>
> Sent from my iPhone
>
> On Feb 19, 2012, at 10:45, Michael Mittiga <mmitt...@electrainfo.com> wrote:
>
>
>
>
>
>
>
> > So would it be safe to say that Fake would not serve well in a daily production process where I need to download multiple transaction amd holdings files from 100+ websites daily? If we were willing to pay for some advances features is that something that would interest you guys?
>
> > On Feb 19, 2012, at 12:09 PM, "Todd Ditchendorf" <todd.ditchend...@gmail.com> wrote:
>
> >> Sorry, no. The only way to control download locations currently is in The General Preferences pane.
>
> >> I'd like to add more features around downloads, but do not have a time frame for that currently.
>
> >> TD
>

iGods

unread,
Dec 22, 2013, 8:11:19 PM12/22/13
to fak...@googlegroups.com, mmit...@electrainfo.com
Yes, this is truly a SERIOUS shortcoming, especially for a workflow app.

iGods

unread,
Dec 23, 2013, 1:23:07 PM12/23/13
to fak...@googlegroups.com, mmit...@electrainfo.com
FYI, this is how I worked around it.

I need to download a series of files from Google WebMaster Tools [for each client; one client demonstrated here], then copy each to a server folder, then move each into a local storage folder for safe keeping.

In a text file, I listed the elements for each file: it's web page ID, it's local folder, and it's server folder:

http://joy.com    /Users/cameron/Data/project/myagency/joy/links/    /Volumes/project/myagency/joy/links
http://www.joy.com    /Users/cameron/Data/project/myagency/joy/links/    /Volumes/project/myagency/joy/links
https://www.joy.com    /Users/cameron/Data/project/myagency/joy/links/    /Volumes/project/myagency/joy/links

In the Fake script, I read in each line from the text file and broke it into its various elements using Javascript (I kept some Javascript alerts commented out in the code to easily peek at the values during development):

-- Do JavaScript
var line = fake.get('line');
var row = line.split('\t');
fake.set('domain',row[0]);
fake.set('localpath',row[1]);
fake.set('serverpath',row[2]);
// window.alert('domain=' + fake.get('domain'));
// window.alert('localpath =' + fake.get('localpath'));
// window.alert('serverpath =' + fake.get('serverpath'));
// now strip http, https, and replace periods with hyphens
fake.set('fileprefix', fake.get('domain').split("http://").join(""));
fake.set('fileprefix', fake.get('fileprefix').split("https://").join(""));
fake.set('fileprefix', fake.get('fileprefix').split(".").join("-"));
// window.alert('fileprefix=' + fake.get('fileprefix'));
// fileprefix should be joy-com and www-joy-com

Then, using an Applescript that accesses [some of] those variables, I did the copy and the move (again, I kept some diagnostic code in place for easy Applescript testing in Script Debugger):


-- Run Applescript:
-- set targetLocalPath to "/Users/cameron/Data/project/myagency/joy/links/"
-- set targetServerPath to "/Volumes/project/myagency/joy/links/"

-- code specific to Fake (uses Fake variables extracted with Javascript)
set targetLocalPath to "${localpath}"
set targetServerPath to "${serverpath}"

tell application "Finder"
   
    -- create source folder if necessary
    set volumeName to boot volume of (system info)
    set TransfersFolder to alias (volumeName & ":Transfers:")
    if (exists (folder "google metrics") of TransfersFolder) is false then
        set sourceFolder to (make new folder at TransfersFolder with properties {name:"google metrics"})
    else
        set sourceFolder to folder "google metrics" of TransfersFolder
    end if
   
   
    -- create targetLocalFolder if necessary
    if (not (exists (targetLocalPath as POSIX file))) then
        set targetLocalFolder to (make new folder (POSIX file targetLocalPath))
    else
        set targetLocalFolder to (targetLocalPath as POSIX file)
    end if
   
    -- create targetServerFolder if necessary
    if (not (exists (targetServerPath as POSIX file))) then
        set targetServerFolder to (make new folder (POSIX file targetServerPath))
    else
        set targetServerFolder to (targetServerPath as POSIX file)
    end if
   
-- display dialog  "targetServerFolder =" & targetServerFolder

    -- set latestGoogleFileAlias to (last file of (sourceFolder) whose name begins with "joy-com") as alias
    -- code specific to Fake (uses Fake variables extracted with Javascript)
    set latestGoogleFileAlias to (last file of (sourceFolder) whose name begins with "${fileprefix}") as alias
   
    duplicate latestGoogleFileAlias to targetServerFolder with replacing
    move latestGoogleFileAlias to targetLocalFolder with replacing
   
end tell


When I got stuck during this script development, I ended up bumping into my own question from months and months ago, so I thought I'd post this solution in hopes of helping anyone else who might be trying this in Fake.

Hope this helps, Merry Christmas everyone.

Cameron Knowlton
Reply all
Reply to author
Forward
0 new messages