How to load scripts from a custom folder in InDesign? like from a central repository - adobe-indesign

I would need a folder to be shared on the server and InDesign CS6 would need to load the scripts from that particular location.
Is this possible?

If you just want to include other scripts in your script you can do this:
$.evalFile(new File(mainscriptloc + "/c/some/folder/central.jsx"));
It will load central.jsx into the executing script just like an "include" file.

On a Mac? I found this solution useful:
http://tewha.net/2012/07/make-a-symbolic-link-from-finder/

The best way I found is to create a folder in any place you want your scripts to be (like a server) which is shared with all the users. Then to setup and run the scripts will be more tricky:
Open ExtendScript Toolkit
Open "Scripts" tab
Click on the top-right button and "Add Favorite"
Choose your path to the script and click ok
Now you can click on the drop down on the left and select "Favorites"
Click on the right drop down and click on your folder name
Double click on your script and run it
Now you are running scripts directly from the custom folder.
The startup script cannot be run from there... so it only works with scripts.

We create links in the users individual scripts folders that link back to the actual script in the central repository on Windows. The downside is of course that users will reasonable often accidentally copy the actual script, rather than a link to the script - and then they miss out on future updates to the script.
Below is an example of a typical users 'scripts panel' folder. Each of the shown shortcuts point at a file in our central repository.
When the user opens InDesign these shortcuts appear in their scripts panel the same way a regular script file would.

On a Mac, I suggest using symlinks (a special kind of OSX shortcut - go here for instructions and an Automator workflow download that will create one whenever you need it).
To create a shortcut, simply select the desired folder (recommended) or file located elsewhere on your computer/server and run the workflow (I suggest making a keyboard shortcut to the workflow as described in the instructions). Drag the shortcut created into your inDesign scripts folder and it will appear and operate exactly as the actual script or folder would in your Scripts Panel. Simply click on the link and inDesign will do the rest - you'll never know what you clicked is not the actual folder/file or that it's located elsewhere.
Note: if you create a shortcut to a script file rather than a folder, be sure to remove the extra text the workflow adds to the name (ie. when applied to "MyScript.jsx", the workflow will create a shortcut named "MyScript.jsx symlink". Remove the " symlink" part so inDesign will recognize the shortcut as a script file. Otherwise it will not run).
I've tested this with inDesign CC on my Mac and it works flawlessly.

Related

Open folder as project in PhpStorm

When I install PhpStorm from JetBrains Toolbox app I do not have an option to open folders as project when right clicking
Sadly JetBrains Toolbox App does not provide such functionality. Only standalone installer has an option to make them right now. You will have to either use that... or create such entries manually.
https://youtrack.jetbrains.com/issue/TBX-2478 -- watch this ticket (star/vote/comment) to get notified with any progress.
To add an entry to the Windows Explorer's right-click menu:
you can use FileTypesMan by NirSoft or a similar tool.
or create such entry manually, e.g. see this comment for a basic .bat file: https://youtrack.jetbrains.com/issue/IDEA-114307#comment=27-2125363 (at very least it lists Registry keys where to create such an entry).
I found this from Jet Brains :
Click Open on the Welcome screen or select File | Open from the main menu.
In the Select Path dialog, select the directory that contains the project to open.
Drag the desired project from your file chooser right to the Open Project dialog without locating it there. The respective file in the dialog will be found automatically.
Specify whether you want to open the project in a new window, close the current project and reuse the existing window, or open the new project in the same window with the current one. Refer to the Opening multiple projects section for details.
and for the command line you could use this :
<PhpStorm> <path_to_the_project folder>
See Open files from the command line for more information.

How to associate types of files in Mac Finder to be opened by IntelliJ IDEA in "LightEdit" mode if I am a JetBrains Toolbox user?

IntelliJ IDEA 2020 can (finally!) simply open a file to be edited, without a project being involved. This is called LightEdit mode.
At this point in a JetBrains video, we see the host platform's file manager app opening a file via IntelliJ while noting that all such files should be opened using that same tool.
No "IntelliJ" application to choose
The problem for me is that I am a happy user of JetBrains Toolbox app to automatically install, upgrade, and open IntelliJ. So in my "Applications" folder on macOS, I have no "IntelliJ" application to choose in the Mac Finder when trying to open a file.
Is there some other way or trick to getting the Finder to know to open files with IntelliJ? And preferably with the latest version, as I believe Toolbox may keep around the older versions.
Basically, I am asking the same as this Question, How to make available “open this project in IntelliJ IDEA” option in Windows context menu, if IntelliJ IDEA has been installed via JetBrains Toolbox?, but for macOS instead of MS Windows. The Answer on that other Question is Windows-specific.
As a Toolbox user you still have access to the "generated shell scripts" (/usr/local/bin/idea, or things like /usr/local/bin/phpstorm, /usr/local/bin/pycharm, etc for individual applications).
But, these are shell scripts, and cannot be used for this because they lack the application identifiers needed by the OS for launching apps.
What you can do is wrap any of this with an Automator application. By wrapping the shell script directly, it should remain updated (since the shell script is itself a Toolbox generated wrapper that points to the latest installed version).
To do so:
Open Automator and click on the "new document" button.
Select "Application".
Add a "Run shell script" action from the library:
Change the "pass input" dropdown from "to stdin" to "as arguments".
Create a script similar to this this (replace phpstorm with idea or whatever IDE you have installed):
for file in "$#"
do
/usr/local/bin/phpstorm -e "$file"
done
Save the application somwhere, with a descriptive name:
Once that one is saved, you'll be able to use it to launch files from Finder, or even set it as default for a file type:
Use the app's menu: IntelliJ IDEA -> Preferences -> Editor -> File Types
Then press the Associate File Types with IntelliJ IDEA button.
A window will open with file groups you could choose from, and then press the OK button, then Apply and another OK.
After this, a MacOS restart is required.

Processing - Change default application icon

How to change the default icon of my Processing appIconTest.exe exported
application in windows ?
The default one :
After some research, the easiest solution i could find is :
Go into ...\processing-3.0.1-windows64\processing-3.0.1\modes\java\application
Save sketch.ico somewhere you can find (renaming it will help).
Place the icon you want to use in the same folder with the same name sketch.ico (which you might create using GIMP).
Now you can export your application from Processing.
Important : Be sure to save the default icon, because every application you export (after changing the icon) using Processing, will have this new icon.
You can change the icon of your running application (the icon that shows up in the title bar of the window and the task bar), but I don't think that's what you're asking about. You can't easily change the icon of the file itself.
That icon seems to be coming from the core.jar Processing library file, so if you want to hack at it, you could try replacing that file in the jar. I really don't recommend that though.
Because the .exe file that Processing exports isn't really an executable anyway- it's really just a shell that calls the code in the lib directory. (source)
If you want to create a real .exe file and have control over its icon, you should look into using a .exe generator like JSmooth or launch4j or JWrapper.
I would recommend Resource Hacker to change the icon of your programs.
Install Resource Hacker (latest build).
Go to your executable file.
Open it with Resource Hacker (right mouseclick, and there should be an option to do that or else you could just click open with).
It will open and show some directories, also one called "Icon", open that one, and right click one one of the icon files (stars with some numbers after that), there will be an option: "replace icon ... Ctrl + R", click that one and replace your icon.

How do I use Mac OS aliases in Sublime Text 3?

I want to open the tree of folders which contains any code on my Mac in Sublime 3. Something like this:
But I don't have all of it in one folder, and it isn't convenient enough to open many folders in Sublime every time I close the app. So I have created 'aliases' (via Finder) to my folders and put them to one (folder), which i want to open with Sublime.
That didn't work out. Sublime opens these aliases as hex code. While ordinary folders open well.
So the main question: is there a way to make this work as I thought via preferences, or any plugin?
Use symbolic links instead by opening Terminal and using ln -s <SOURCE> <ALIAS>.
You can keep any number of folders you want collected in one place by using projects. Simply drag the folders you want, in the order you want, into the sidebar. Then, select Project -> Save Project As... and save the file anywhere you want with the .sublime-project extension. While you're at it, make sure you have
"hot_exit": true
in your user settings, as this enables you to close windows which have a project assigned to them, and all open files and unsaved changes are automatically preserved. When you next open the project, everything will be the same.

Force Firefox not to change file extension?

Is it possible to force Firefox not to change the file extension of a file the user downloads? Currently I have the problem that I have a .reg file to download, but Firefox, even though in the Download dialog it says "Text file (*.reg)", saves it as a .reg.txt file, which is highly annoying. How to fix this?
You could try to do the following things:
1.) https://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file
Maybe extension (in your case .reg) is associated with Notepad and you could changed it in Options/Applications
a) Click the menu button and choose Options.
b) Select the Applications panel.
c) The Applications panel will display. Select the type of file for which you want to change the default action.
2.) https://bugzilla.mozilla.org/show_bug.cgi?id=511624
This is an old bug, but if you use the affected version of firefox...
When you right click on a link to a batch file and click save as, it will allow you to save it, but it automatically adds .txt to the end of the filename without informing you.
You are unable to save it as .bat
Reproducible: Always
Steps to Reproduce:
1.Right click on a batch file link
2.Click save as
3.Save it
Actual Results:
filename is file.bat.txt
Seems to be a Firefox on Windows bug. My coworker was implementing download of .reg files and I use Firefox, I tested for him and got a .reg.txt. Just renaming it after download was sufficient to make the .reg work, but I got curious if that would happen on Linux also.
Grabbed my laptop where I have Ubuntu installed and the file was downloaded with the correct extension (just didn't run because .reg is a windows extension, it did open in the text editor). It was not automatically renamed as a .txt.

Resources