Script not working in cs6, after working in cs5

Hello,
I have a script and when I try to access app.documents.length
or app.documents[0] or app.activeDocument
then I get the error:
General photoshop error occurred. This functionality may not be available in this version of Photoshop
- <no additional info is available>
any idea ?
Thanks

Thanks Paul,
My script is like this:
<javascriptresource>
<name>$$$/JavaScripts/ExportGeotiff/Menu=Export Geotiff...</name>
<about>$$$/JavaScripts/ExportGeotiff/About=Export Geotiff ^r^rCopyright 2011 Company. All rights reserved.^r^rExports document into a Geotiff image.</about>
</javascriptresource>
try
alert("OK HERE");
exportGeoTiff();
catch(err)
alert(err.description);
function exportGeoTiff()
if (app.documents.length == 0) //***** CRASHES HERE
  error("No document to export.");
var scriptPath = getScriptPath();
var geotifcp = getGeotifcp(scriptPath);
var doc = app.activeDocument;
var geo = getGeoInfo(doc);
var inputGeoFile = saveGeoInfo(scriptPath, geo);
var file = saveDoc(doc);
var inputTiffFile = prepareInputTiff(scriptPath, file);
var outputTiffFile = runGeotifcp(geotifcp, scriptPath, file);
inputTiffFile.remove();
inputGeoFile.remove();
outputTiffFile.remove();
function error(err)
throw new Error(err);
function getScriptPath()
var path = "C:\\Program Files (x86)\\Company\\Common\\Maps\\";
var folder = Folder(path);
if (!folder.exists)
  path = "C:\\Program Files\\Company\\Common\\Maps\\";
folder = Folder(path);
if (!folder.exists)
  error("Could not find map common folder.");
return path;
function getGeotifcp(path)
var geotifcp = File(path + "geotifcp.cmd");
    if (!geotifcp || !geotifcp.exists)
  error("Could not find geotifcp utility.");
return geotifcp;
function getGeoInfo(doc)
var raw = doc.xmpMetadata.rawData;
var tag = "xmpMM:RenditionParams>";
var geo = raw.substring(raw.indexOf("<" + tag) + tag.length + 1, raw.indexOf("</" + tag));
if (!geo || (geo.length == 0))
  error("Document has no Geo-Reference information. Export cancelled.");
//escape XML:
    geo = geo.replace(/&#xA;/g, "\r\n");
return geo;
function saveGeoInfo(path, geo)
var inputGeoFile = File(path + "input.geo");
    if (!inputGeoFile)
  error("Could not create geo input file.");
if (!inputGeoFile.open("w"))
  error("Could not open geo input file.");
if (!inputGeoFile.write(geo))
  error("Could not write to geo input file.");
if (!inputGeoFile.close())
  error("Could not close geo input file.");
return inputGeoFile;
function saveDoc(doc)
var file = File.saveDialog("Save As", "Tiff:*.tif");
if (!file)
  error("Save cancelled");
doc.saveAs(file, new TiffSaveOptions(), true, Extension.LOWERCASE);
if (file.length == 0)
  error("Saving to tiff failed. Export cancelled.");
return file;
function prepareInputTiff(path, file)
var inputTiffFile = File(path + "input.tif");
    if (!inputTiffFile)
  error("Could not create input file.");
if (inputTiffFile.exists)
  if (!inputTiffFile.remove())
   error("Could not delete input file.");
if (!file.copy(inputTiffFile.fsName))
  error("Could not copy image to input file.");
if (!inputTiffFile.exists)
  error("Problem copying image to input file.");
return inputTiffFile;
function runGeotifcp(geotifcp, path, file)
if (!geotifcp.execute())
  error("Failed adding geo info to tiff.");
$.sleep(1000);//let geotifcp finish
var outputTiffFile = File(path + "output.tif");
    if (!outputTiffFile || !outputTiffFile.exists)
  error("Could not create geotiff file.");
if (!outputTiffFile.copy(file.fsName))
  error("Failed replacing tiff image with Geotiff version.");
return outputTiffFile;

Similar Messages

  • I have a problem with the device does not accept 5 slot after work and survey content is not possible activation of the device and iTunes

    I have a problem with the device does not accept 5 slot after work and survey content is not possible activation of the device and iTunes imei: 01******206
    <Personal Information Edited by Host>

    لدي جهاز ترقفت الشبكه ويعطي جاري البحث وتم تحديثه ولم يتم حل المشكلهة  والان الجهاز لايقبل التنشيط والايتونز لايتعرف عليه امل تنشيطه 013619004986206

  • I can not open my CS6, after that 30 day add for CC finally stopped.  I'm not surprised though. How do I open CS!

    I can not open my CS6, after that 30 day add for CC finally stopped.  I'm not surprised though. How do I open CS6!

    Run the cleaner tool and reinstall.
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    Mylenium

  • 500 GB Hard Disk will not mount on iMacs (after working fine for months)

    setup : 2x iMac 24" 10.5.6..wired to airport Xtreme, Iomega 500 GB HD connected via USB
    this drive worked fine and has all the pics on it and was used to backup both iMac's via Time Machine.
    Today the Airport Xtreme (AX) gives us a flashing orange light and informs us that the 500 GB Iomega disk needs to be connected to the mac and needs to be repaired.
    so...we did, with a "disk appears to be OK " message after 'repair'
    mounting from within Disk Utility gives us : "The disk “500HD” could not be mounted.
    Try running First Aid on the disk and then retry mounting."
    (we did just that...!)
    We also tried "Drive Genius" with the same results.
    whether we hook the drive to the AX or directly to the iMac...no mounting.
    The drive (and it's partition) does appear perfectly in both 'Disk Utility' and in 'Drive Genius'
    (The iMac does mount other USB items like mem-sticks, camera's just fine.)

    While it doesn't sound like this is really the problem since OTHER devices work on the USB ports, never the less, it is an easy thing to try out anyway.
    First thing to do is reset the USB chip set on the mother board. Unfortunately, when you power down the computer there is always a bit of power still applied to the motherboard to keep things alive and this usually includes powering the ports to do stuff like detect when a device is plugged in or wants to wake up the computer. The downside of this is when a bus/port chipset goes into a weird state, locks up, etc., simply power cycling (shutdown & restart) the computer won't work.
    So first thing to try is resetting the chipset and to do this you have to power down the computer and completely unplug the computer from the wall power (unplug the power cord to your Mac). Also unplug everything from the Mac's ports (USB, FW, Ethernet, etc.) to make sure no parasitic power is still there to keep the chipset alive. Now let it sit for a minute (give those big power caps in there time to discharge). Now reattach the keyboard & mouse only, plug the power cord back in, & start up the Mac. Now see if your USB ports work any better.
    Best of luck!
    Patrick
    What to do if your computer won't recognize a FireWire or USB device
    http://support.apple.com/kb/HT1317?viewlocale=en_US

  • Help. 3D isn´t working in CS6 after update. open GL

    I just updated my photoshop to the latest version provided in the application manager.
    i created a 3D document in front, had no problems except 1 crash while working with 3D layers.
    now it won´t let me open this psd becaus Open GL is not activated.
    Need to finish this, heeeeeeeelp
    thanks in advance,
    Slevin

    How much video RAM (vRAM) do you have?
    Photoshop's Cloud update 13.1 upped the minimum required from 256MB to 512MB for 3D features.
    http://blogs.adobe.com/crawlspace/2012/10/heads-up-photoshop-system-requirement-changes.ht ml
    http://helpx.adobe.com/photoshop/kb/new-system-requirements-photoshop-131.html

  • MJPG codec not working in CS6, but working in CS5.5

    When I open AVI with MJPG codec in Premiere Pro CS6 video is black. Same file works on Premiere Pro CS5.5.
    Same computer, same codecs. Why?
    I've seen few suggestion to buy MJPG codec for $30-$40.
    Why, if it's working on CS5.5?
    EDIT: I have test file for you to try on Your Premiere CS6:
    https://dl.dropbox.com/u/89503700/bf3_2013_01_13_21_34_15_463.avi

    When I open AVI with MJPG codec in Premiere Pro CS6 video is black. Same file works on Premiere Pro CS5.5.
    Same computer, same codecs. Why?
    I've seen few suggestion to buy MJPG codec for $30-$40.
    Why, if it's working on CS5.5?
    EDIT: I have test file for you to try on Your Premiere CS6:
    https://dl.dropbox.com/u/89503700/bf3_2013_01_13_21_34_15_463.avi

  • My Bluetooth keyboard will not pair with os7 after working perfectly before the update

    My iPad mini won't pair with my Bluetooth keyboard anymore after updating to os7

    Forget the device again, then turn off bluetooth on your iPad, then turn both the iPad and the keyboard completely off. Wait 30 seconds to one minute. Now turn on your iPad and turn on bluetooth. Turn on your keyboard and pair them up again.

  • Why can I not enter my CS6 after buying a new iMac?

    I leased today an new iMac at the distributor shop adminsystems in Cologne. Mr. Heck, ther owner an the administrator for me wanted to migrate all the data and programms and applications tfrom the old Imac 21,5 " to the new iMac. That would be done by the number which was on the package CS 6 Education Software, I bought over the shop adminsystems im March 2013. After tipping the number you have send me a new number to confirm it. cause I had to switch the provider from 1&1 to all-inkl  relaunching my website, I lost the registration number, I can´t find it. It is payed and I am a teacher of the KISD in Cologen, you must have the confirmation of the administration bureau KISD Cologne Ubierring. Now, whenever I want to use CS6 Education Standard, the Mac asks me for the number. can you send the the number, cause everything is clear and correct payed.
    The Leasing Contract ist signed by dialogbar Mrs. Eva Degenhardt and philosophiekunst e.V.
    With best wishes
    Wolfgang Neisser
    [excessive signature removed by admin]

    Das ist 100% Schwachsinn. Die Programme müssen korrekt installiert werden. Migrationsassistent oder Timemachine kanste in dem Fall in der Pfeife rauchen. Für alles andere den Edu Support anrufen/ per Formular anfunken oder was auch immer. Und beim nächsten Mal den ganzen Spam weglassen.
    Mylenium

  • JQuery script not working after DW update

    After updating to the latest DreamWeaver Version 12 build 5861 a jQuery script for collapsible panels no longer works.
    I had used the script many times in the past few years on various sites and when I open the html and php pages I created in the past the script still runs in Live View and as a web page.
    As I mentioned above since I updated to build 5861 the script no longer works for any new pages I create. I used FireFox view source to confirm the links to the jQuery engine and the actual script are correct. I have placed the engine script link above the actual script, as well as deleted additional links to other engines used by other plug-ins.
    Any thoughts would be appreciated.

    I discovered the cause but not the solution.
    After the update and the creation of a new site the first element I created involved a jQuery script and when I went to check it's functionality it failed. I have been mostly obsessing on getting various scripts to work. As I mentioned if I placed the code in the head all was fine, if I linked to a script file it failed and according to FireFox view source the html was linked to the file.
    Well a few minutes ago I bypassed the script issue and placed an image in a document and saw that Dreamweaver wrote the code as a absolute path to the image rather than a relative path.
    Before the update DW accepted a relative path for the scripts such as:
        <script type="text/javascript" src="scripts/diQuery-collapsiblePanel.js"></script>
    After the update I can get the scripts to work if I enter absolute paths:
        <script src="http://localhost/panel/scripts/diQuery-collapsiblePanel.js"></script>
    The funny thing is that the CSS files work fine with relative paths.
    I thought perhaps I set the site up incorrectly and had the links referencing the Site Root instead of the document but thats not the case. It is set to Document and should be creating Relative paths to images.
    I can not see any other Preference settings involving the way paths are written. I would really like to get back to Relative paths for all elements.
    Any thoughts?

  • I run a script in win 7 Enterprise it worked but not in window 8.1

    I run a script that hides folders and it worked in window 7 Enterprise, but then when I tried it in window 8.1 it did not work at all. Is there something I am missing ?
    public void StartDir()
    DirectoryInfo dii;
    String discT = @"C:\\Test0137";
    String disc1 = discT + @"\NotePsn";
    dii = Directory.CreateDirectory(disc1);
    ToggleHidden(disc1);
    public void ToggleHidden(string filename)
    string path = filename;
    DirectoryInfo di = Directory.CreateDirectory(path);
    di.Attributes = FileAttributes.Directory | FileAttributes.Hidden;

    Following the suggestion from Thomas, I modified my script. It worked perfectly on my Window 7 Enterprise.Then I just took my flash-memory(where my script reside) and plugged it in my laptop (window 8.1) and started to run the script but it did not hide
    the directory I intended to hide, and I did not get any  error message either. I also tried to generate directories in different discs ...still it did not work. This Script is the corrected version after the suggestion of Thomas and Michael Taylor:
    public void StartDir()
    DirectoryInfo dii;
    String discT = @"C:\\Test0137";
    String disc1 = discT + @"\NotePsn";
    dii = Directory.CreateDirectory(disc1);
    ToggleHidden(disc1);
    public void ToggleHidden(string filename)
    string path = filename;
    DirectoryInfo di = new DirectoryInfo (path);
    di.Attributes = FileAttributes.Directory | FileAttributes.Hidden;

  • Drag and drop not working in CS6?

    Hey guys, we recently updated to Fireworks CS6 (from CS5) @ work and while I do love the speed upgrade, there is one thing different that I cannot get past, I cannot drag and drop a document onto the Fireworks menu bar, I need to Open > File every time, its time consuming and frustrating... why would you drop this feature in CS6? :| Am I missing something?

    Ah, so it does work in Fireworks CS6—just not on your setup at work. Again, is this a Mac or Windows OS?
    After re-reading your initial post, I realized I'm not clear on what you mean by dragging and dropping a document "onto the Fireworks menu bar". I was initally picturing dragging a document onto the Fireworks application icon in the Mac OS dock (or the Windows equivalent to this, if there is one).
    Are you actually talking about the command menu that appears across the top of the application interface? If so, I can't open a document using this method in either CS5 or CS6.

  • Flash 6 vs Flash 8, Script not working, Fla attached

    Can some please help me and tell me why the action script
    which makes the pictures enlarge on mouseover works with flash 6
    publish settings but not flash 8.
    ...nevermind, figured it out, thanks....
    Thanks a million!
    Rich

    unless you uncheck "autokerning" in property inspector, your
    textfields
    auto-activate html mode, so your number is wrapped in html
    tags.
    really weird!
    jaya_r schrieb:
    > Hi
    >
    > I tried this simple script in the trial version of Flash
    8 which does not
    > seem to be working. Can anyone please let me know what
    could possibly be the
    > problem. When i used the same script in Flash MX 2004,it
    worked. However even
    > after re-installing the trial version of Flash 8,it does
    not work. Basically
    > this is what i made:
    >
    > 1) input text field with a variable name of :inputNum
    > 2)dynamic text field with a variable name of :outputBool
    > 3)made a button with an instance name : enter_btn
    > 4)put this code in the actions layer:
    >
    > enter_btn.onRelease=function(){
    > outputBool=(inputNum<100);
    > };
    > var inputNum:Number=0;
    > var outputBool:Boolean=true;
    >
    > At the outset, it shows 0 in the 'inputNum' and the true
    in the
    > 'outputBool'.However when i enter any number in the
    inputNum it shows
    > 'undefined' in the outputBool. Why is that so? Would
    really appreciate an
    > answer.
    >
    > Thanks
    > Jayashree
    >

  • Adobe Encoder CS6 stopped working, not start.

    Hello,
    I have a PC with the following characteristics:
    Motherboard: Intel DX58SO
    CPU: Intel i7 2.97GHz
    RAM: 8 Gb
    Hard Disks: 2 in RAID (7200RPM)
    The problem is:
    Adobe Encoder CS6 stopped working, not start, what can I do?
    No works wanting to export from Premiere CS6 or opening it alone.
    Thanks

    Good luck with that, and don't forget to deactivate CS6. 
    My system is slowing down after nearly two years, and I am dreading a reinstall - there always seems to be something you have forgotten!  What really worries me is what happens to existing raid0 arrays seeing as the mainboard needs drivers.   They are backed up, but I just don't trust a single level backup, and will have to add a further 3Tb of drive space to make a straight copy of the raid0 arrays.  I also like the idea of Windows 8.1, but dread finding out that the drivers don't work!
    The Premiere Pro hardware forum is the perfect place to ask about stuff like that.  Harm, Bill, Erik etc. are super clued up on such things, so I shall run my concerns past them before committing. 
    So I wish you good luck again, and I know you'll make a plan before going ahead with it.

  • PhotomergeUI.plugin is not working in CS6 for Mac

    I am using Photosho CS6 on a Mac. I urgently need the PhotomergeUI.plugin to be working. It was working in Photoshop CS5 after conversion to a 32-bit version. CS6 for Mac is only provided as a 64-bit version. Is there any way to make the plugin work for me? Many thanks!! Simone

    No, unfortunately the photomerge ui plugin will not work in photoshop cs6 on the mac side.
    You can always use photoshop cs5 for those times when you really need it.
    In photoshop cs6 you could align your photos manually as best you can, then select all the layers and go to Edit>Auto-Blend Layers>Panorama with Seamless Tones and Colors checked

  • Not working imessage!! I can not send imessage than after apple id. There are problems with Apple ?? Thanks!

    Not working imessage!! Credit card and I can not send imessage than after apple id. There are problems with Apple seeverele?? Thanks!
    Before the service reset function. Wait 24 hours to activate imessage.

    go to the settings and turn off imessage
    but that don't change the issue that you will never be able to facetime eachtoher
    the appleID is really meant as the handle that identify you it was not meant to be shared
    but can see that people may want to do not buy apps more then once

Maybe you are looking for

  • IDVD does not start

    With the launching of iDVD6, the loading of the topics the programe stop. I am obliged to force to leave (iDVD does not answer any more) Have you a sollution Thank you and excuse me for the bad language I am French

  • Arch install experience / install CD uses devfs path names

    Hey, all I'm new to the forums, very happy arch user. I can't remember how I found arch, it must've been fate. I did my share of distro hopping. Actually, I plunged into the deep end with my first Linux install by choosing to run Gentoo. To their cre

  • What is the need of xi in idoc to idoc related scenarios

    Hi all,                                                                                 Can any one explain me what is the need of xi in idoc to idoc related scenarios.\ we can Send Idoc with out Xi right?                                             

  • Error 1628...failed to complete installation

    Every time I try to install my ITunes upgrade I receive an error 1628. First I couldn't open my ITunes because I did not have an up to date version of Quicktime. When I tried to upgrade I received this error during installation. I tried all of the tr

  • Audition adds noise after processing

    Hello, I've got a big issue here. Adobe Audition CS6 (Version 5.0.2 Build 5), OSX 10.8.4 I've got a file with speech (mono, 48 kHz, 16t bit), starting and ending with digital silence. Let's say I want to normalize it. Done. Now I'm saving (cmd+s). An