Search found 1023 matches

by freddyp
Thu Jun 06, 2019 9:45 am
Forum: LEGACY scripting
Topic: file cleanup
Replies: 3
Views: 5491

Re: file cleanup

You must use $doc instead of app.activeDocument. You must write the output in $outfolder and you must add the output file path to the array $outfiles. Without testing: var saveOptions = new IllustratorSaveOptions(); saveOptions.compatibility = Compatibility.ILLUSTRATOR15; saveOptions.compressed = fa...
by freddyp
Wed Jun 05, 2019 2:04 pm
Forum: LEGACY scripting
Topic: file cleanup
Replies: 3
Views: 5491

Re: file cleanup

There are a couple of rules to be followed, and then all will be well:
https://www.enfocus.com/manuals/UserGui ... tions.html
by freddyp
Wed May 29, 2019 10:04 am
Forum: LEGACY scripting
Topic: Save an Array in Private data
Replies: 2
Views: 4543

Re: Save an Array in Private data

The easiest way to convert any JS object to a string is to convert it to JSON. And then back again:

Code: Select all

var arr = ["a","b","c"];
var arrAsJSON = JSON.stringify( arr);
var backToArray = JSON.parse( arrAsJSON);
by freddyp
Tue May 28, 2019 4:57 pm
Forum: LEGACY scripting
Topic: Dataset to XML String
Replies: 2
Views: 4383

Re: Dataset to XML String

A dataset IS a file, so all you need to do is read it:

Code: Select all

var datasetAsString = File.read( jData.getPath());
by freddyp
Fri May 10, 2019 9:26 am
Forum: Applications
Topic: Adobe Creative Cloud license for Switch
Replies: 3
Views: 8379

Re: Adobe Creative Cloud license for Switch

Photoshop is NOT my first choice for processing images. It is slow and it can only process one image at the time. It is much more efficient to use ImageMagick. It is a command line tool that is available as a free download: https://imagemagick.org/index.php . You can quite easily integrate it in a S...
by freddyp
Thu May 09, 2019 1:39 pm
Forum: Flows
Topic: Paused HTTP GET (error)
Replies: 6
Views: 7701

Re: Paused HTTP GET (error)

When the server returns a 4xx HTTP status code (400 or higher means an error), the job is sent along the error connection and you can build a clean flow. The most logical status code is 404: URL not found. The description you give suggests that it returns a 5xx error (these errors mean that there is...
by freddyp
Thu Apr 18, 2019 1:05 pm
Forum: Flows
Topic: RegEx Case Insensitive
Replies: 3
Views: 5063

Re: RegEx Case Insensitive

/regex/i is something you use in scripting. You do not specify it but I am assuming you are using a condition with variables with [Job.Name] on the left-hand side "Matches" as an operator and the regular expression on the right-hand side. Assuming I am right, what you need to do is this: c...
by freddyp
Wed Apr 17, 2019 8:38 am
Forum: LEGACY scripting
Topic: Scripting with InDesign - Remove Pasteboard & Re-Link Files
Replies: 13
Views: 15257

Re: Scripting with InDesign - Remove Pasteboard & Re-Link Files

You should read the "Javascript for applications" part of the Switch documentation. There it says what variables you MUST use. And because you are not using them, ... Also note that you can specify a script for three steps of the process: a script for opening the file (which you do not nee...
by freddyp
Tue Apr 16, 2019 2:25 pm
Forum: Flows
Topic: Combine two XML files into one
Replies: 2
Views: 3658

Re: Combine two XML files into one

One approach is to use the "Make XML" app ( https://www.enfocus.com/en/appstore/product/make-xml ). You create the structure you want and you insert variables taking values from both datasets. If the number of fields you are interested in is not too high, this is definitely the easiest way...
by freddyp
Tue Apr 09, 2019 6:07 pm
Forum: LEGACY scripting
Topic: Don't send Login and password in plain text within the url to web service?
Replies: 6
Views: 8214

Re: Don't send Login and password in plain text within the url to web service?

When using GET, parameters are passed as part of the URL. That is how it works. Perhaps this page clarifies a few things:
https://www.plus2net.com/php_tutorial/variables2.php
by freddyp
Tue Apr 09, 2019 2:38 pm
Forum: LEGACY scripting
Topic: Don't send Login and password in plain text within the url to web service?
Replies: 6
Views: 8214

Re: Don't send Login and password in plain text within the url to web service?

Does it matter what authentication method you use? Of course it does! It is the server that determines what method you have to use. The method you described first (credentials specified as parameters) is actually used by some web services (not very often though), so at first sight it was not impossi...
by freddyp
Thu Mar 28, 2019 11:08 am
Forum: LEGACY scripting
Topic: Log to Excel
Replies: 5
Views: 7728

Re: Log to Excel

There is a typo in the script: Public Function initializeMicraosoftExcel() Set initializeMicrosoftExcel = CreateObject( "Excel.Application" ) End Function vs Set theExcel = initializeMicrosoftExcel() In other words, the initialize function is not executed and there is no valid Excel object.
by freddyp
Mon Mar 25, 2019 9:05 am
Forum: LEGACY scripting
Topic: Scripting the date
Replies: 1
Views: 3999

Re: Scripting the date

You can get hold of the individual parts with the getDate(), getMonth(), getYear() functions and then you concatenate them in the way you need.
by freddyp
Thu Mar 07, 2019 6:26 pm
Forum: LEGACY scripting
Topic: PitStop action lists via script
Replies: 16
Views: 22010

Re: PitStop action lists via script

The solution with all the action list in a preflight profile and activating the required ones using SmartPreflight variables is also the method that I immediately thought of when I read the original question. You make it sound as if grouping action lists in a preflight profile is a problem. Can you ...
by freddyp
Mon Mar 04, 2019 9:49 am
Forum: Flows
Topic: Unable to add filename to InDesign file
Replies: 2
Views: 3509

Re: Unable to add filename to InDesign file

Check if the resulting file has an empty text frame. If it has, it simply means that the value of $arg1 is empty. $arg1 is the value of the "Argument 1" property, not the name of the file. If you want it to be the name of the file, you have to define "Argument 1" as a single-line...